Skip to content

2.27.0.0-b408

@basavaraj29 basavaraj29 tagged this 04 Aug 18:17
Summary:
Flag `enable_ysql` is enabled by default, which control the creation and initialization of `PgSupervisor`. It only makes sense for us to enable object locking/create `TSLocalLockManager` iff when ysql is enabled.

As of today, `TSLocalLockManager` is created when flag `enable_object_locking_for_table_locks` is set. Some tests operate with `enable_ysql` disabled, and this causes failures when we enable object locking feature. This is because, on the transaction finish/commit path, we try making a call to the release the object locks if any, and the lock manager waits for it to be bootstrapped. The bootstrap never happens since the ysql lease poller is never started because `enable_ysql` is false.

This revision addresses the issue by creating `TSLocalLockManager` iff both `enable_object_locking_for_table_locks` and `enable_ysql` are set. By doing this, `PgClientSession` treats the feature of object locking as disabled since it cannot find the lock manager.
Jira: DB-17762

Test Plan:
Enabled object locks and ran the following, they fail prior to the changes in this reision.
```
./yb_build.sh --cxx-test='TEST_F(PggateTestSelect, TestSelectOneTablet) {'
./yb_build.sh --cxx-test='TEST_F(PggateTestSelectMultiTablets, TestSelectMultiTablets) {'
./yb_build.sh --cxx-test='TEST_F(PggateTestSelectInequality, TestSelectInequality) {'
./yb_build.sh --cxx-test='TEST_F(PggateTestDelete, TestDelete) {'
```

Reviewers: rthallam, amitanand, zdrudi, #db-approvers

Reviewed By: amitanand, #db-approvers

Subscribers: svc_phabricator, ybase

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