You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To serve reads leader need to have active leases, but also leases of old leader should expire.
We take lease for 2 seconds, so after leader change we could not serve reads for this time.
In case when leader change was caused by leader step down, new leader could contact old leader and ask him to revoke his lease.
So new leader could start serving requests as soon as old leader approves lease revocation.
The text was updated successfully, but these errors were encountered:
Summary:
To serve up-to-date read requests, the leader need to have active leases (a regular lease and a
hybrid-time lease), but also any leases held by any old leader of that tablet should have already
expired. The latter condition is also a requirement for processing write requests. We use a
two-second lease interval by default, so after a leader change we might not be able to serve reads
and accept writes for this amount of time.
This revision introduces the following changes:
- In case when a leader change was caused by a leader step-down, the new leader will contact the old
leader and ask it to revoke its lease. The new leader could start serving requests as soon as the
old leader approves the lease revocation.
- The old leader will automatically revoke its leases when it receives a consensus update from the
new leader.
- The new leader will understand that the old leader does not have a lease anymore as soon as the
old leader replies to a consensus update.
Test Plan:
ybd --cxx-test snapshot-txn-test --gtest_filter SnapshotTxnTest.BankAccountsWithTimeJump
Time jumps produces a lot of leader changes. So leader lease revocation allows us to write about three times more values than w/o revocation.
Reviewers: timur, mikhail
Reviewed By: mikhail
Subscribers: bogdan, ybase, bharat
Differential Revision: https://phabricator.dev.yugabyte.com/D6278
To serve reads leader need to have active leases, but also leases of old leader should expire.
We take lease for 2 seconds, so after leader change we could not serve reads for this time.
In case when leader change was caused by leader step down, new leader could contact old leader and ask him to revoke his lease.
So new leader could start serving requests as soon as old leader approves lease revocation.
The text was updated successfully, but these errors were encountered: