-
Notifications
You must be signed in to change notification settings - Fork 911
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
Fix query cancellation collateralizing future queries using the same connection #1000
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.
Please squash your commits and fix the test flake and I think I can merge this.
I've updated the tests and squashed the commits |
Need to remove go 1.13 which doesn't support some of the sync stuff here. Doing that in #1014. |
This change causes a public API change that breaks our app. |
If you submit a PR that reverts this change and adds a test to prevent this regression in the future I'll merge it. |
Hello. |
68577: protectedts,kvserver: add UpdateTimestamp method to the storage interface r=ajwerner a=adityamaru This change introduces a UpdateTimestamp method that can be used to update timestamp protected by a protected time stamp record. A next commit will add some logic to the verification code to ensure that an update is picked up correctly during the Verify() call. Release note: None kvserver: modify pts verification to check Timestamp as well Previously, when verifying a pts record we would find the record we are attempting to verify from the cache on the basis of the record ID. This was correct until we added a way to update a records Timestamp in the previous commit. If a record is updated with a new ts, and a verification request is sent for this updated record, then we want to ensure that request is not serviced on the basis of the old record. This is possible if the cache is too stale. To prevent this we now match both the record ID and the timestamp to protect after, when finding the cache entry corresponding to the request. In this way, if we do see the older record then the verification will fail the first time around, the cache will refresh, and we will see the new record the second time around. Release note: None 68665: workload: ignore ErrBadConn if context has been canceled r=otan a=rafiss fixes: #68574 fixes: #68585 refs: lib/pq#1000 lib/pq can return this error if the context has been canceled. Release note: None Co-authored-by: Aditya Maru <adityamaru@gmail.com> Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
We've just run into the same issue inside CockroachDB. A query cancellation should not drop the connection. |
I think #1079 will address the issues with this PR |
I have updated #1079 with the code review comments in case it helps. |
This change solves the following issue we were seeing in production:
The changes I've made to ensure we don't run into this collateral damage:
Note: We probably don't need to change
bad
to an atomic variable, but I did just to be safe.