-
Notifications
You must be signed in to change notification settings - Fork 981
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
Reset replica flags after stable state fail #1013
Conversation
Signed-off-by: adi_holden <adi@dragonflydb.io>
Signed-off-by: adi_holden <adi@dragonflydb.io>
LOG(INFO) << "Error greeting " << ec; | ||
state_mask_ &= ~R_TCP_CONNECTED; | ||
LOG(INFO) << "Error greeting " << ec << " " << ec.message(); | ||
state_mask_ &= R_ENABLED; |
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.
this change has the same affect as ~R_TCP_CONNECTED because the only flag enabled in this state is R_TCP_CONNECTED and R_ENABLED, but this change makes it more readable and if we add new state between connect and greet we will not need to do any change here so this is more robust
@@ -249,7 +247,8 @@ void Replica::MainReplicationFb() { | |||
else | |||
ec = ConsumeRedisStream(); | |||
|
|||
state_mask_ &= ~R_SYNC_OK; | |||
LOG(WARNING) << "Error full sync " << ec << " " << ec.message(); | |||
state_mask_ &= R_ENABLED; |
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.
This is the fix. After full sync exit we start from beginning
LOG(ERROR) << "Bad FLOW response " << ToSV(leftover_buf_->InputBuffer()); | ||
return make_error_code(errc::bad_message); |
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.
Wow... I never noticed we skipped this error return
reset replica state to R_ENABLED after stable state exit inorder to start reconnecting to master with new sync id