Skip to content

fdb push: always resolve tier name in _hndl_open#6063

Draft
emelialei88 wants to merge 1 commit into
bloomberg:mainfrom
emelialei88:fix/fdb-push-default-typestr
Draft

fdb push: always resolve tier name in _hndl_open#6063
emelialei88 wants to merge 1 commit into
bloomberg:mainfrom
emelialei88:fix/fdb-push-default-typestr

Conversation

@emelialei88

@emelialei88 emelialei88 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • After 8a158e0 replaced class_override with push->class != get_my_mach_class(), _hndl_open passes the unresolved literal "default" to cdb2_open when the remote DB is on the same tier as the local node. This leaks "default" into the sockpool typestr (e.g. comdb2/<db>/default/newsql/<policy>), which is invalid — the tier slot must contain a resolved name like dev or prod.
  • In normal builds this silently prevents sockpool reuse for same-tier fdb push connections (no cached connection matches a "default" typestr). In CDB2API_TEST builds it aborts in cdb2_socket_pool_get.
  • Always resolve via mach_class_class2name(push->class) regardless of whether the tier matches the local machine's class.

Test plan

  • Verify _hndl_open no longer produces a typestr containing "default" when remote and local tiers match
  • Run Lua SP with remote db:exec on same-tier DB under CDB2API_TEST build — no longer aborts
  • Existing fdb_push test suite passes (exercises the _hndl_open path, though it does not build with CDB2API_TEST so it cannot catch the typestr issue directly)

🤖 Generated with Claude Code

After 8a158e0 replaced class_override with a class != get_my_mach_class()
check, _hndl_open would pass the unresolved string "default" to cdb2_open
when the remote DB is on the same tier as the local node. This caused the
literal "default" to leak into the sockpool typestr, which is invalid —
the tier slot must contain a resolved class name.

Always resolve via mach_class_class2name regardless of whether the remote
tier matches the local one.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@emelialei88 emelialei88 marked this pull request as draft July 7, 2026 18:59

@roborivers roborivers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cbuild submission: Success ✓.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_resume_logicalsc_generated **quarantined**
reco-ddlk-sql **quarantined**
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants