Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor refactoring of slot migration source code #1373

Merged
merged 2 commits into from
Apr 7, 2023

Conversation

torwig
Copy link
Contributor

@torwig torwig commented Apr 6, 2023

Unused variables were removed.
Some variables and methods were renamed.
Destination socket descriptor wrapped by UniqueFD and moved outside SlotMigrationJob (now it contains only migration parameters ).
Enum classes were used instead of plain enums.
Move the logic of setting the forbidden slot into SetForbiddenSlot and call it explicitly between two calls of syncing from WAL.

Comment on lines +109 to +110
Status FinishSuccessfulMigration();
Status FinishFailedMigration();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two method name changes seem wordy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that new names clearly describe what they do.

@@ -111,7 +111,7 @@ class ServerLogData {
};

class SlotImport;
class SlotMigrate;
class SlotMigrator;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we just name SlotImport and SlotMigrate, let's keep it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got your point. The reason is that I didn't touch slot_import.h/.cc in this PR.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll suggest you separate different refactor aspects in different commits the next time. Otherwise, it's hard to review..

@torwig
Copy link
Contributor Author

torwig commented Apr 6, 2023

@tisonkun You are absolutely right: it's hard to review because of so many changes.

Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General LGTM, left one comment.

src/cluster/slot_migrate.h Outdated Show resolved Hide resolved
@torwig torwig requested a review from PragmaTwice April 7, 2023 08:44
@torwig
Copy link
Contributor Author

torwig commented Apr 7, 2023

@PragmaTwice Could you please have a look at my PR? As @tisonkun advised, I can split it into several distinct PRs to make the review more convenient. What do you think?

Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, expect SlotImportor like SlotMigrator though.

@torwig
Copy link
Contributor Author

torwig commented Apr 7, 2023

@PragmaTwice I'll handle SlotImport in the next PRs.

@git-hulk
Copy link
Member

git-hulk commented Apr 7, 2023

Thanks all, merging...

@git-hulk git-hulk merged commit 8d5ccbc into apache:unstable Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants