-
Notifications
You must be signed in to change notification settings - Fork 467
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
Conversation
Status FinishSuccessfulMigration(); | ||
Status FinishFailedMigration(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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..
@tisonkun You are absolutely right: it's hard to review because of so many changes. |
There was a problem hiding this 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.
@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? |
There was a problem hiding this 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.
@PragmaTwice I'll handle |
Thanks all, merging... |
Unused variables were removed.
Some variables and methods were renamed.
Destination socket descriptor wrapped by
UniqueFD
and moved outsideSlotMigrationJob
(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.