Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#11946] DST: PITR - Correctly set op id when replaying snapshot oper…
…ations during tablet bootstrap Summary: Currently, we don't set op id when replaying snapshot operations during tablet bootstrap. However, we flush the snapshot entry into the sys catalog immediately after the create succeeds and also update the frontier. This can cause a duplicate replay of the same snapshot op with the same snapshot id. On the master side, we treat this as FATAL and crash. In particular, consider the following case: - Cluster is running pre 2.6, where we flush rarely. It adds CREATE_ON_MASTER to the WAL - Cluster is updated to 2.6+, during local bootstrap we replay this CREATE_ON_MASTER and add snapshot record to RocksDB. And flush RocksDB, but op.id is not initialized properly so it does not contain CREATE_ON_MASTER record - Cluster is restarted, it tries to replay CREATE_ON_MASTER again, but it is already present in DB, so the master crashes. Separately, we should also add some logic to bypass the duplicate snapshot request and not crash. This would be governed by a GFlag. By default, the behavior would be to crash but if someone runs into this issue then they can turn it on and complete the bootstrap and then again turn it off. Test Plan: Tested manually by bringing in data and wals from a 2.4.x that has an unflushed CREATE_ON_MASTER op to master and performed steps (2) and (3). Without the fix it crashes, with this fix it doesn't replay. Also, tested that we can bypass without crashing on the above data. Reviewers: bogdan, sergei Reviewed By: sergei Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D16314
- Loading branch information
1 parent
9e02ccf
commit fe2b082
Showing
4 changed files
with
81 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters