Open GuptaManan100 opened 3 days ago
Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.
release notes (needs details)
label if users need to know about this change.-
), and have a clear help text.Jobs
should be named in order to mark it as required
.required
, the maintainer team must be notified._vt
tables and RPCs need to be backward compatible.vtctl
command output order should be stable and awk
-able.Attention: Patch coverage is 70.90909%
with 16 lines
in your changes missing coverage. Please review.
Project coverage is 69.44%. Comparing base (
3743f09
) to head (d664547
). Report is 8 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
This PR makes the changes required to make Reshard work with Atomic transactions. Before these changes, Resharding won't wait for prepared atomic transactions to go through, and we could be in a situation where a prepared transaction is unable to commit on the source shards because we have stopped query service on it. At the same time, that prepared transaction won't exist on the target shards, leading to us being unable to commit a prepared transaction altogether.
This PR fixes this situation by changing the
RefreshState
RPC that Resharding is using. Now, when vttablet is executing theRefreshState
RPC, if it decides that query service needs to be stopped, it first turns off the two pc engine from accepting new prepared transactions and then waits for the current prepared transactions until they're resolved. This ensures Resharding doesn't proceed until all the prepared transactions have concluded.This PR adds fuzzer and stress tests to verify that the changes work as intended. The changes in this PR are different from the ones proposed in the RFC https://github.com/vitessio/vitess/issues/16245#issuecomment-2273836571, because we found that this solution is more elegant and easier to implement than the one proposed there.
Related Issue(s)
Checklist
Deployment Notes