-
Notifications
You must be signed in to change notification settings - Fork 138
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
CBG-4067: do not release doc sequence upon timeout error #7016
Conversation
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 LGTM, just some questions about the tests, and some code nits you can take or leave.
@@ -121,6 +121,8 @@ type LeakyBucketConfig struct { | |||
|
|||
ForceErrorSetRawKeys []string // Issuing a SetRaw call with a specified key will return an error | |||
|
|||
ForceTimeoutErrorOnUpdateKeys []string // Specified keys will return timeout error AFTER write is sent to server |
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 interesting because this definitely means the write occurred. However, in the case of this ticket, we don't know whether the write went through or not? Is there a reason to actually have this error after it writes and not before?
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 want this behaviour as this is what the customer saw. See ticket linked to this for more info but they had write, server under load and operation times out, but write eventually succeeds but we've timeout and release the document sequence. Then then the successful write is ignored at cache due to duplicate sequence with the released sequence.
It certainly seems odd to do it this way but its the only way I could think of mocking/forcing this situation reliably in a test. We cannot be sure when we hit timeout that the write will eventually go through or not but the changes this PR makes will protect against docs being missed in replications if the write does succeed.
…rror (#7133) * CBG-4067: do not release doc sequence upon timeout error (#7016) * CBG-4067 Only skip releasing sequences for timeouts (#7050) We want to release sequences in scenarios where we know the write did not occur. --------- Co-authored-by: Gregory Newman-Smith <[email protected]> Co-authored-by: Adam Fraser <[email protected]>
…rror (#7133) * CBG-4067: do not release doc sequence upon timeout error (#7016) * CBG-4067 Only skip releasing sequences for timeouts (#7050) We want to release sequences in scenarios where we know the write did not occur. --------- Co-authored-by: Gregory Newman-Smith <[email protected]> Co-authored-by: Adam Fraser <[email protected]>
CBG-4067
Pre-review checklist
fmt.Print
,log.Print
, ...)base.UD(docID)
,base.MD(dbName)
)docs/api
Integration Tests
GSI=true,xattrs=true
https://jenkins.sgwdev.com/job/SyncGateway-Integration/2617/