Skip to content

pebble: move expansion merge and rollback methods onto Expansion - #1207

Open
kans wants to merge 1 commit into
refactor/2-ii-digestsfrom
refactor/2-iii-expansion
Open

kans wants to merge 1 commit into
refactor/2-ii-digestsfrom
refactor/2-iii-expansion

Conversation

@kans

@kans kans commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1206. Third pebble.Engine split: the 15 methods from merge_surface.go, merge_accessor.go, rollback_expansion.go, expand_write_path_stats.go move to Expansion, same shape as Digests and SyncRuns. Bodies unchanged beyond e. → x.e..

Two things differ from the plan's table. synthLayer and the four write counters stay on Engine: grants.go writes them, so they are shared with the record path, not owned here; ExpandWritePathStats reads them through x.e. And Expansion carries the raw Pebble surface the compactor uses (NewIter, Get, IngestSSTs, NewFoldBatch, DropKeyRange, ReplaceRangeWithSSTs, Metrics, EstimateDiskUsage, LogCompactionMetrics, UnsafeForTesting, PebbleEngine) because those lived in merge_surface.go / merge_accessor.go. If that name reads wrong for the compactor's use, it is a rename, not a re-split.

Callers go through Expansion(): pebble_store.go (RollbackExpansion), adapter_reader.go (NewIter), and pkg/synccompactor/pebble/{compactor,kway,merge,overlay}.go. No forwarders, no new pebbleStore methods, export status unchanged.

Checks: go build ./..., go vet ./..., golangci-lint clean; go test ./pkg/dotc1z/... -count=1 ok including TestWriteMuHolders; focused -run 'Expan|Merge|Rollback|Synth|Layer' across pkg/sync and pkg/synccompactor ok.

Methods from merge_surface.go, merge_accessor.go, rollback_expansion.go and expand_write_path_stats.go move to the Expansion sub-type with the fields only they use. Bodies are unchanged beyond the receiver rewrite.

Co-authored-by: Cursor <cursoragent@cursor.com>
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