Skip to content

feat(source/kafka): cold-group seek/lag, typed start-offset option, honest vendor-boundary docs - #200

Merged
joshua-temple merged 1 commit into
mainfrom
feat/source-v1-capabilities
Aug 23, 2026
Merged

feat(source/kafka): cold-group seek/lag, typed start-offset option, honest vendor-boundary docs#200
joshua-temple merged 1 commit into
mainfrom
feat/source-v1-capabilities

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Checkpoint 2/5 — P1 fixes on the road to source/v1.0.0

Stacked on #199 (checkpoint 1).

P1-4 — cold-group Seek/Lag silently no-oping

SeekToStart/End/Time built requests purely from CommittedOffsets(); a fresh group got an empty request and succeeded while doing nothing. Now assignedPartitions enumerates committed offsets per topic where present and falls back to broker metadata (kmsg.MetadataRequest) for topics without commits — seeks always act. Lag needs a committed baseline: it now returns exported ErrNoCommittedOffsets (errors.Is-matchable) for a cold group instead of 0, nil, and counts only partitions with commits (documented).

P1-5 — initial start-offset policy exposed + documented

New WithStartOffset(kafka.StartEarliest | kafka.StartLatest) mapping to kgo.ConsumeStartOffset; default stays earliest (franz-go's default), committed partitions always resume from commit regardless. Cold-start posture documented in the package doc (# Cold start) and README (## Cold start).

P1-3 — false vendor-free claim corrected

"No franz-go type appears in an exported signature" was false. Rewritten to the real boundary in both kafka.go package doc and README: neutral seam vendor-free; WithSASL/WithBalancer/WithClientOptions/WithClient are deliberate typed power seams. Core Seekable/LagReporter docs updated to describe actual enumeration/baseline semantics.

Evidence (run locally on this branch)

Check Command Result
kafka build/vet/race GOWORK=off go build ./... && go vet ./... && go test -race -count=1 ./... ok
core vet/race go vet ./... && go test -race -count=1 . ./memsource ok

New tests (all pass under -race -count=1): TestSeekToStartColdGroupDiscoversPartitions, TestSeekToEndUsesCommittedWhenPresent, TestSeekToTimeColdGroupMixedTopics, TestLagColdGroupErrorsWithSentinel, TestLagPartialCommitsCountOnlyCommitted, TestTopicPartitionsErrorPropagates, TestWithStartOffsetOptionConfigAndMapping.

Regressions vs baseline: none (full suites green). API diff vs review-approved list: adds only WithStartOffset, StartOffset + StartEarliest/StartLatest constants, and ErrNoCommittedOffsets sentinel — all required by approved P1 fixes.

…onest vendor-boundary docs

P1-4: SeekToStart/SeekToEnd/SeekToTime enumerated partitions from committed
offsets only, so a fresh group (nothing committed) silently no-oped. Partition
discovery now falls back to a kmsg MetadataRequest for any consume topic
without commits; Lag keeps the committed baseline but reports an error
(exported ErrNoCommittedOffsets sentinel) instead of a misleading 0 for a cold
group, and excludes never-committed partitions.

P1-5: WithStartOffset(kafka.StartEarliest|StartLatest) maps onto
kgo.ConsumeStartOffset for brand-new groups (default earliest = franz-go
default); committed partitions always resume from their commit. Cold-start
posture documented in package doc and README.

P1-3: 'No franz-go type appears in an exported signature' corrected to the
real boundary in kafka.go package doc and README: the neutral Inlet/
Subscription/Message seam is vendor-free; WithSASL/WithBalancer/
WithClientOptions/WithClient deliberately expose franz-go types as power seams.
Core Seekable/LagReporter doc comments updated to match backend behavior.

Tests: cold-group seek discovery, committed-vs-metadata partition selection,
mixed-topic coverage, Lag cold-group sentinel + partial-commit counting,
metadata error propagation, WithStartOffset mapping.
@joshua-temple
joshua-temple force-pushed the feat/source-v1-capabilities branch from 6c81f15 to 730b579 Compare August 23, 2026 03:06
@joshua-temple
joshua-temple merged commit f106825 into main Aug 23, 2026
121 checks passed
@joshua-temple
joshua-temple deleted the feat/source-v1-capabilities branch August 23, 2026 03:18
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