Skip to content

Small fixes: journal routing, selector double-slash, null handling#2718

Merged
jgraettinger merged 4 commits intomasterfrom
johnny/small-fixes
Mar 3, 2026
Merged

Small fixes: journal routing, selector double-slash, null handling#2718
jgraettinger merged 4 commits intomasterfrom
johnny/small-fixes

Conversation

@jgraettinger
Copy link
Copy Markdown
Member

Summary

Smaller seemingly independent changes that came out of developing and testing an update to gazette routing behavior.
The RocksDB change is a bonus from some extra sanity checking I did. It makes the local implementation more-correct / defensive, but wasn't actually possible in the wired application.

  • gazette: always use routing topology in client — Updates the gazette
    journal client to always route through the topology (Primary for appends,
    Replica for reads/fragments) instead of conditionally falling back to the
    default service address when do_not_proxy was set. Also fixes reads to
    re-pick a routed subclient when transitioning from the metadata request to
    the content stream, ensuring the content read goes to a broker that actually
    serves the journal rather than whichever broker handled the initial metadata
    RPC.

  • flowctl: fix double-slash in journal list selector — The authorization
    endpoint returns journal_name_prefix with a trailing slash, but
    assemble::journal_selector() adds its own slash when building selectors.
    This produced collection/name//pivot=00 patterns that matched nothing.
    Now strips the trailing slash from the prefix before passing it to the
    assembler.

  • control-plane-api: fix null spec_type crash in live_specs dataloader
    Adds ls.spec_type is not null to the join condition so that soft-deleted
    live_specs rows (which have a null spec_type) are excluded from the
    dataloader query instead of crashing at deserialization.

  • rocksdb: fix panic on null merge-patch operand, broaden fuzz coverage
    When a full merge-patch reduction with a null operand fires the LWW delete
    flag, the value position is removed from the [key, doc] array. The merge
    operator now handles this case by emitting JSON null instead of panicking
    on an out-of-bounds index. Fuzz test coverage is broadened to include scalar
    and null operands (not just objects), which exercises the NotAssociative
    partial-merge path.

Testing

Verifed flowctl collections list, list-fragments, list-journals, and read now work (no longer produces double-slash selectors)

jgraettinger and others added 4 commits February 27, 2026 21:51
A null top-level merge-patch operand triggers the LWW delete flag
during full reduction, removing position 1 from the [key, value]
array. The extraction code assumed array[1] always exists, causing
a panic. Handle the missing position by emitting JSON null, which
is the correct RFC 7396 result for merge(anything, null).

Also broadens the QuickCheck fuzz test to generate non-object
operands (scalars, nulls, arrays), exercising NotAssociative
batching paths that were previously excluded by an is_object() guard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nal routing

Production Gazette deployments don't use a reverse proxy, and the
client-side behavior of ignoring known topology when `do_not_proxy`
wasn't set was counterproductive: there are requests (like metadata
fetches) where you want a peer to forward on your behalf for reduced
latency, while still using the response's route on a subsequent
request.

If a reverse proxy setup were reintroduced, the proxy itself would be
responsible for rewriting response headers to reference itself rather
than the internal brokers it fronts.

Concretely:
- Append, Fragments, and Read always use topology-aware routing
  (Primary or Replica as appropriate) instead of falling back to
  Mode::Default when `do_not_proxy` is unset.
- In read_some, capture metadata response routing before branching,
  fixing a gap where the fragment-URL path lost routing info.
- Re-pick a routed subclient before starting a direct journal read,
  so the data stream is served by a broker that actually serves the
  journal rather than the arbitrary default dialed for metadata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deleted specs can have null spec_type, which caused the dataloader
query to fail with "unexpected null" since the column was annotated
as non-nullable. Filter them out in the join condition instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The authorization endpoint returns journal_name_prefix with a trailing
slash (added in snapshot.rs for binary-search purposes), but
assemble::journal_selector() also appends one when building the
name:prefix label. This produced a double-slash (e.g.
"collection/gen1234//") that matched no journals, breaking
list-journals, list-fragments, split-journals, and collection reads.

Strip the trailing slash in build_label_selector before passing through
to journal_selector.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@psFried psFried left a comment

Choose a reason for hiding this comment

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

LGTM

@jgraettinger jgraettinger merged commit ca36acb into master Mar 3, 2026
11 checks passed
@jgraettinger jgraettinger deleted the johnny/small-fixes branch March 3, 2026 15:52
github-actions bot pushed a commit to estuary/homebrew-flowctl that referenced this pull request Mar 25, 2026
This release includes support for the upcoming materialization triggers feature, in addition to several other bugfixes and improvements.

## What's Changed
- Fix double-slash in journal list selector breaking collection reads by @jgraettinger in estuary/flow#2718
- Include flowctl version in publication details by @psFried in estuary/flow#2748
- Improve error message for concurrent spec modifications by @jwhartley in estuary/flow#2678
- Add support for materialization triggers by @williamhbaker in estuary/flow#2800
williamhbaker added a commit to estuary/homebrew-flowctl that referenced this pull request Mar 25, 2026
This release includes support for the upcoming materialization triggers feature, in addition to several other bugfixes and improvements.

## What's Changed
- Fix double-slash in journal list selector breaking collection reads by @jgraettinger in estuary/flow#2718
- Include flowctl version in publication details by @psFried in estuary/flow#2748
- Improve error message for concurrent spec modifications by @jwhartley in estuary/flow#2678
- Add support for materialization triggers by @williamhbaker in estuary/flow#2800
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