Skip to content

Fix map read error translation and config validation - #1178

Merged
FZambia merged 2 commits into
masterfrom
fix-map-read-err-and-validation
Jul 6, 2026
Merged

FZambia merged 2 commits into
masterfrom
fix-map-read-err-and-validation

Conversation

@FZambia

@FZambia FZambia commented Jul 6, 2026

Copy link
Copy Markdown
Member

Correctness fixes.

Fixes

  • Translate the unrecoverable-position error in the map read API methods so clients receive the proper error.
  • Fix config validation: use fmt.Errorf args in transform error messages, and correct the h2c_external check when the internal port is empty.

FZambia added 2 commits July 5, 2026 00:31
MapReadState and MapReadStream mapped every node error to ErrorInternal, unlike
History which translates centrifuge.ErrorUnrecoverablePosition to the code-112
API error. The map read paths return ErrorUnrecoverablePosition on epoch
mismatch / trimmed stream, so a client paginating a map stream past a trimmed
point (or reading state with a stale revision epoch) got a 100 internal error
instead of 112, its recovery logic never fired, and a normal recovery event was
logged as a server fault. Translate it like History does.
Two validation bugs:
- validateCodeToUniDisconnectTransforms used errors.New with a %d directive for
  the two to.* checks, so the index was emitted literally ("transforms[%d].to")
  instead of substituted; the sibling checks already use fmt.Errorf. Use
  fmt.Errorf with the loop index.
- The h2c_external check only rejected when the external port equaled a non-empty
  internal_port, so enabling h2c_external with internal_port left at its default
  (empty) passed validation - but at runtime internal falls back to the external
  port, applying h2c to the shared server, exactly the setup the check forbids.
  Also reject when internal_port is empty.
@FZambia
FZambia merged commit 18812f4 into master Jul 6, 2026
4 checks passed
@FZambia
FZambia deleted the fix-map-read-err-and-validation branch July 6, 2026 18:04
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.

1 participant