jangjang0401 opened a new pull request, #1702:
URL: https://github.com/apache/cloudberry/pull/1702

   ### What does this PR do?
   When a hot standby coordinator runs on a dedicated host with no primary
   segments, `getCdbComponentInfo()` crashes with SIGSEGV.
   
   `hostPrimaryCountHash` is built from primary segment hosts only. When
   `IS_HOT_STANDBY_QD()` is true, the loops over `segment_db_info` and
   `entry_db_info` also process mirror/standby entries. On a dedicated
   standby host that owns no primary segments, `HASH_FIND` returns NULL.
   The subsequent `Assert(found)` or direct dereference of `hsEntry` causes
   a SIGSEGV, crashing every backend that attempts to connect.
   
   The bug is masked when the standby coordinator shares a host with primary
   segments, because the hostname already exists in the hash by coincidence.
   
   Fix by treating a missing hash entry as a count of zero.
   
   ### Type of Change
   - [x] Bug fix (non-breaking change)
   
   ### Test Plan
   - Reproduced on a cluster where the standby coordinator is on a dedicated
     host (no primary segments). `psql` to the standby crashed with SIGSEGV
     before this fix and connects successfully after.
   
   ### Impact
   **User-facing changes:**
   Connections to a hot standby coordinator no longer crash when the standby
   host runs no primary segments.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to