Skip to content

2.25.1.0-b125

@druzac druzac tagged this 03 Jan 15:35
Summary:
First diff to implement the lease for table and advisory locks.

Main pieces:

  - Proto changes to track leases on the tablet server sys catalog proto
  - logic on the master heartbeat side to mark them as live for heartbeating tservers
  - logic in the background thread to mark them as expired and clean up locks held by tservers with expired leases
  - some changes to the async rpc task code and the object info manager to ignore tservers w/ expired leases

GFlags added:

  - `enable_client_operation_lease` - feature flag to enable or disable the lease feature. Currently a test flag. Defaults to off. Will be replaced with an auto flag or a non-test flag later.
  - `client_operation_lease_ttl_ms` - flag to control how long lease extensions are.

**Upgrade/Rollback safety:**

Proto changes are some new optional fields added, and an existing field is moved. The existing field is only read if a test flag defaulting to false is enabled, so these changes do not affect production clusters.

Jira: DB-14211

Test Plan:
New test to verify locks held by tservers that lose their lease are eventually cleaned up:
```
./yb_build.sh --skip-java --cxx-test-filter-re object_lock-test --cxx-test object_lock-test --gtest_filter 'ObjectLockTest.ReleaseExclusiveLocksWhenTServerLeaseExpires'
./yb_build.sh --skip-java --cxx-test-filter-re object_lock-test --cxx-test object_lock-test --gtest_filter 'ObjectLockTest.TServerLeaseExpiresBeforeExclusiveLockRequest'
./yb_build.sh --skip-java --cxx-test-filter-re object_lock-test --cxx-test object_lock-test --gtest_filter 'ObjectLockTest.TServerLeaseExpiresAfterExclusiveLockRequest'
```

Existing tests pass:
```
./yb_build.sh --cxx-test-filter-re object_lock-test --cxx-test object_lock-test
```

Reviewers: amitanand, bkolagani

Reviewed By: amitanand

Subscribers: ybase, slingam

Differential Revision: https://phorge.dev.yugabyte.com/D40262
Assets 2
Loading