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.
sql: changed LeaseManager API to return/use table descriptors
The Acquire/AcquireByName and Release() methods no longer return/use a LeaseState and instead return/use a sqlbase.TableDescriptor with an expiration time. the LeaseManager is moving towards a model where it returns a table descriptor with an expiration time for the use of the table descriptor. For now this table descriptor is associated with a lease, but in the future it might be an older version of the table descriptor, in which case it will not have a lease. With this change, leases on the same table descriptor version are renewed under the covers without needing the API to issue an explicit release on a table descriptor version. The refcount on the old lease is simply transferred to the new one. The new lease is guaranteed to have a higher expiration time and thus a prior returned expiration time returned by the API is guaranteed to be contained within the new lease expiration time. A Release() on the table descriptor will reduce the refcount on the current lease. In the future, this will reduce the refcount on a table version which might not be associated with a lease. Removed the need to use removeLeaseIfExpiring since once a transaction has picked a timestamp and a valid table descriptor for the timestamp the table descriptor need not be reacquired through the API. related to cockroachdb#2948
- Loading branch information
1 parent
e968655
commit a95331a
Showing
22 changed files
with
362 additions
and
398 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
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.