-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, incrementing sequences at a high throughput would result in many distributed writes to the KV layer due to MVCC. This has caused garbage collection problems in the past. This would occur in situations such as bulk importing data while using the sequence number as an id for each new row being added. This change allows clients to cache sequence numbers in their local session data. When the cache is empty, the sequence will be incremented once by the cache size * increment amount, which are both sequence options. Then, all the intermediate values will be cached locally on a node to be given out whenever the sequence is incremented. To accommodate schema changes, cached sequences values will be invalidated when new descriptor versions are seen by the cache. This invalidation can occur when old versions are seen as well to accommodate schema change rollbacks. Release note (sql change): Using the CACHE sequence option no longer results in an "unimplemented" error. The CACHE option is now fully implemented and will allow nodes to cache sequence numbers. A cache size of 1 means that there is no cache, and cache sizes of less than 1 are not valid.
- Loading branch information
1 parent
11db4d0
commit 850a09e
Showing
11 changed files
with
914 additions
and
407 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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.