-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
45826: storage: enforce gc ttl strictly r=ajwerner a=ajwerner This PR creates a cluster setting to control whether the GC TTL is enforced "strictly". Strict GC enforcement is not a strong guarantee that we will serve no user reads whatsoever for timestamps that are older than the current reading of the node's clock less the GC TTL. Rather it is a setting to enable the behavior that most of the time, most requests will see an error if they use a timestamp which is older than the GC TTL. The main case in which the user will see an error is if the only reason a read would be able to request a timestamp was because of a protected timestamp. The process of verifying a protected timestamp will prevent this case. If the users of protected timestamps verify the protected timestamp before they operate, or they use admin commands, they'll be fine. In the presence of a protected timestamp, all requests can read back to that protected timestamp. Lease transfers are another source possibility for data to be visible at the GC Threshold rather than the TTL. Strict mode is controlled via a cluster setting. Strict mode does not apply to admin commands or to system ranges. The interesting thing with this all is that the problem which prompted this setting in the first place was due to backups being run at a period longer than the GC TTL and pretty much never failing. Backups in 20.1 (in theory) are going to use protected timestamps. If they successfully verify the protected timestamp then they'll be able to still succeed an even higher percentage of the time! If we want to discourage this behavior we could * Have the protected timestamp subsystem enforce that clients can't save data they currently view as expired. This is probably a bad idea because interestingly enough the protected timestamp subsystem ignores zone configs completely. * Have the higher levels try to do it. This seems probably better. The backup pulls the table descriptors and knows exactly the timestamp ranges it's backing up. In a lot of cases I can imagine wanting to back up data that is expired. Making that hard would probably be worse than making messing up like this worse. It probably also has zone configs. I might instead just warn loudly in this case. What this will do is bring greater awareness of the GC ttl. If you don't update or delete data frequently the GC hueristic won't kick in for quite some time. Release justification: bug fixes and low-risk updates to new functionality Release note (general change): GC TTLs will now be enforced by default. This enforcement can be controlled by disabling `kv.gc_ttl.strict_enforcement` Co-authored-by: Andrew Werner <[email protected]>
- Loading branch information
Showing
25 changed files
with
585 additions
and
83 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.