Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#23645] docdb: Reorder heartbeat handling logic to fix regression.
Summary: A prior commit (15786f3) unintentionally re-ordered some logic in the heartbeat handling path. Before this commit, there was a sequence: 1. Potentially register heartbeating TServer. 2. Fill response with various metadata for piggy-backing features. 3. Lookup heartbeating Tserver. The commit merged the logic of registering and looking up a tserver into: 1. Potentially register heartbeating TServer and look it up. 2. Fill response with various metadata for piggy-backing features. If a TServer needed to register say after a master leader failover, the old code would stop handling the heartbeat request at the lookup stage, after filling in the heartbeat for piggy-backing features. However the new code after commit 15786f3 would stop handling the heartbeat before populating the response. This broke a few system tests. This diff simply reorders registering / looking up the TServer with populating the response. This is not exactly the same as the original semantics - if registering a TServer yields an error the old code wouldn't populate the response but the new code would - but these are edge cases. It's not entirely clear the old code ever returned an error on the registration path, or that this condition is ever triggered in practice. At any rate preserving these semantics is not worth the complexity. Jira: DB-12556 Test Plan: ``` ./yb_build.sh --cxx-test master_heartbeat-itest --gtest_filter MasterHeartbeatITest.PopulateHeartbeatResponseWhenRegistrationRequired ``` Reviewers: jhe, hsunder Reviewed By: jhe, hsunder Subscribers: hsunder, slingam, ybase Differential Revision: https://phorge.dev.yugabyte.com/D37629
- Loading branch information