Skip to content

Release - #216

Merged
ovaistariq merged 1 commit into
releasefrom
main
Aug 17, 2026
Merged

ovaistariq merged 1 commit into
releasefrom
main

Conversation

@ovaistariq

@ovaistariq ovaistariq commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Note

Cursor Bugbot is generating a summary for commit 99e3f52. Configure here.

…ED (#215)

* perf(compaction): drop compaction I/O from page cache via FADV_DONTNEED

Compaction reads one-pass raw-file/segment inputs and writes segment
outputs through the page cache, evicting warm serving data. Track
written output ranges per segment and drop them (plus one-pass input
pages) with posix_fadvise(FADV_DONTNEED) only after the segment is
synced; no-op on non-Linux. Also adds the missing newSeg.Sync() before
recompaction metadata publish.

Candidate cand_g41znje23g from perfloop case_61m5ctxv01, validated
locally (memory-limited Linux containers, mincore-based residency).

Signed-off-by: Ovais Tariq <[email protected]>

* docs: RFC-008 compaction page cache hygiene

Signed-off-by: Ovais Tariq <[email protected]>
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds Linux page-cache advice to discard compaction input and synced output ranges, explicitly syncs recompaction output before publishing metadata, and adds correctness tests, Linux residency benchmarks, and an RFC.

  • Tracks and merges output ranges per compaction batch.
  • Applies FADV_DONTNEED to consumed inputs and durable outputs, with a no-op implementation on non-Linux platforms.
  • Extends compaction and recompaction tests to read back migrated values.
  • Adds serving-cache residency and latency benchmarks.

Confidence Score: 4/5

The PR appears safe to merge, though input cache advice should be delayed until metadata no longer exposes the source to avoid undermining warm serving reads during compaction.

Output ranges are accurately tracked and dropped only after synchronization, but both compaction paths can evict input pages while those files remain the published source for concurrent reads.

Files Needing Attention: storage/compaction/compactor.go, storage/compaction/recompactor.go

Important Files Changed

Filename Overview
storage/compaction/cache_advice.go Adds well-bounded per-segment output-range tracking and a best-effort path-based cache-drop callback.
storage/compaction/cache_advice_linux.go Implements Linux cache eviction using FADV_DONTNEED while deliberately ignoring advisory failures.
storage/compaction/compactor.go Tracks and drops synced output correctly, but drops raw-file input pages while metadata can still direct serving reads to them.
storage/compaction/recompactor.go Establishes sync-before-metadata durability and output cache hygiene, but prematurely evicts still-live old-segment input pages.
storage/compaction_serving_bench_linux_test.go Adds guarded mincore-based page-residency and serving-latency benchmarks without an identified unsafe-slice failure.
docs/rfcs/RFC-008-compaction-page-cache-hygiene.md Documents the design and measurements, but its assertion that input drops cannot affect readers overlooks the pre-commit serving window.

Reviews (1): Last reviewed commit: "perf(compaction): drop compaction I/O fr..." | Re-trigger Greptile

advice.addOutput(*newSeg, newOffset, totalNeeded)

// Old segment values are one-pass recompaction input.
dropFileCache(oldFile, entry.Offset, totalNeeded)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Input advice evicts serving pages

If serving reads overlap compaction, this call discards old-segment pages while published metadata still directs reads to that segment, forcing warm values to be reread from disk; the raw-file drop in copyFileIntoSegment has the same pre-commit behavior.

Knowledge Base Used: Storage Lifecycle: Compaction, Eviction, and Deletion

@ovaistariq
ovaistariq merged commit 950127d into release Aug 17, 2026
12 of 13 checks passed
@tigrisdata-argocd-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.10.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants