forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
descs: unify uncommitted and kv descriptors
Relates to cockroachdb#64673. Previously, the collection maintained two separate sources: `uncommittedDescriptors` and `kvDescriptors`. This was confusing because `uncommittedDescriptors` was intended to contain modified descriptors, but it also held descriptors cached from KV point lookups. This commit fixes this by introducing `storedDescriptors`, which is the combination of the above sources. This commit works towards a model where `storedDescriptors` is a mirror of the descriptors in KV. These descriptors were either cached after KV reads, or were modified by the associated transaction and should be written to KV upon commit. Now, all descriptors read from storage are stored in the same btree, eliminating possible duplication between `kvDescriptors` and `uncommittedDescriptors`. As a byproduct of this change, we are able to better leverage caching due to virtual table lookups within a transaction. First, we no longer need to invalidate batches of cached descriptors after schema changes. Second, point lookups after a range lookup will properly check the descriptors cached due to the range lookup. Release note: None
- Loading branch information
Jason Chan
committed
Jul 19, 2022
1 parent
7d021d3
commit 0c2a6f7
Showing
19 changed files
with
995 additions
and
819 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
Oops, something went wrong.