This PR addresses a bug reported by customers involving the table partition manager. The issue occurs when a worker is the owner of a partition without claiming the lease. This can happen when a worker restarts or crashes and returns to a healthy state before the lease expires, thus it remains the owner of the partition. In our current logic, the worker only listens to a control queue when it has claimed a lease. Therefore, in the above scenario worker will continue to renew the lease without listening to queue messages.
To resolve this, the PR adds a check to ensure that when a worker reads the partition table and identifies itself as the current lease owner, it verifies if it is actively listening to the queue. If it is not, the worker should initiate the process to start listening to the queue. This ensures that the lease renewal logic only applies when the worker is actively managing the partition.
This PR addresses a bug reported by customers involving the table partition manager. The issue occurs when a worker is the owner of a partition without claiming the lease. This can happen when a worker restarts or crashes and returns to a healthy state before the lease expires, thus it remains the owner of the partition. In our current logic, the worker only listens to a control queue when it has claimed a lease. Therefore, in the above scenario worker will continue to renew the lease without listening to queue messages.
To resolve this, the PR adds a check to ensure that when a worker reads the partition table and identifies itself as the current lease owner, it verifies if it is actively listening to the queue. If it is not, the worker should initiate the process to start listening to the queue. This ensures that the lease renewal logic only applies when the worker is actively managing the partition.