-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#24310] DocDB: Fix wrong retention time could be picked when snapsho…
…t schedule is enabled Summary: When snapshot schedule is active, we retain records from being compacted until there is snapshot that contains this record. Due to race condition we could get into situation where tablet replica consider snapshot as taken while it does not have it. TServer receives last schedule snapshot time via heartbeat mechanism. There are 2 places that could lead to described bug. 1) Master sends last snapshot time for schedule that is not yet complete. 2) Snapshot is taken on leader and one follower, while another follower did not complete snapshot yet. Fixed by switching to maintain last snapshot time locally and store this information in filesystem. When snapshot is created for some schedule, we create file in snapshots folder named: last_snapshot.[SCHEDULE_ID].[SNAPSHOT_TIME]. And remove previous file for the same schedule. During tablet bootstrap we list all files in snapshot folder, recovering latest snapshot times and removing outdated files. Jira: DB-13199 Test Plan: ./yb_build.sh release -n 400 --gtest_filter YbAdminSnapshotScheduleTest.PgsqlAddColumnCompactWithPackedRow -- -p 8 Reviewers: timur Reviewed By: timur Subscribers: ybase Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D40893
- Loading branch information
Showing
11 changed files
with
192 additions
and
84 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
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
Oops, something went wrong.