Repository navigation
Antalya 26.8: Short-circuit idle CAS GC rounds, cache terminal mount ETags, and suppress idle heartbeats - #2920
Open
sks wants to merge 1 commit into
Conversation
…and suppress idle heartbeats Reduces idle S3 traffic on settled CAS pools without weakening lease-steal or deletion safety: 1. CasGcScheduler: suppress periodic gc/hb writes in heartbeatLoop() when no round is in flight and the last round did not fail transiently; skip synchronous gc/hb write in onLeaseAcquired() on steady-state leader renewals (gc/state lease seq bump already proves liveness). 2. computeHeartbeatFloor (CasServerRoot): cache terminal (gc_fenced / clean-release) mount ETags across rounds and skip per-slot GET/readModifyWrite when LIST returns the same ETag. 3. CasGc: add per-round CasFoldSeal cache (avoiding duplicate fold_seal GETs and gen-0 404s) and steady-state IdleBaseline short-circuit (comparing catalog ETag and cas/ns/stream/ (key, etag) SipHash fingerprint) so settled idle pools skip drain, walk-plan, janitor re-scans, and periodic forced empty folds. 4. Update gtest_cas_gc_round_defer.cpp, gtest_cas_gc_log.cpp, and docs/en/antalya/cas/architecture/garbage-collection.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: sabith <sks@stackgen.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Even on an idle CAS pool where zero new parts are written and
shouldDeferRounddefers the fold,CasGcSchedulerandCasGcstill execute substantial background S3 request volume:CasGcScheduler::heartbeatLoop()writesgc/hb(GET+PUT) everyhb_interval = interval / 4even when no round is running (!round_in_flight), andonLeaseAcquired()pulsesgc/hbsynchronously on every steady-state renewal.computeHeartbeatFloor()callsreadModifyWrite(GET) on every/mountslot undergc/server-roots/, including immutable terminal (gc_fencedand clean-release) slots whoseLISTETag has not changed.CasGc::runRegularRound()reads the samefold_sealkey multiple times per round, unconditionally forces a fullfold()everygc_fold_max_defer_rounds(8) rounds even whenchanged_shards == 0, and re-readscas/ref_catalogandnamespace_cleanupon every idle tick.Changes
CasGcScheduler(CasGcScheduler.h/.cpp):gc/hbpulses inheartbeatLoop()when!round_in_flight && !last_round_failed_transiently. BecauseacquireOrRenewLease()bumpsgc/state.lease.seqevery interval, followers still observe steady-state leader liveness, while active long folds and transient-failure recovery retain fullgc/hbprotection.pulseHeartbeat()inonLeaseAcquired()on steady-state renewals when already leader.computeHeartbeatFloor(CasServerRoot.h/.cpp):gc_fenced/ clean-release) mount ETags across rounds inGc::mount_terminal_cacheand skipGET/readModifyWritewhenLISTreturns the matchingEtag.CasGc&CasNamespaceJanitor(CasGc.h/.cpp,CasNamespaceJanitor.h/.cpp):CasFoldSealcache (readFoldSeal) so a single round reads a given(generation, attempt)fold seal at most once (and zero times for generation0).SipHash(key, etag)fingerprint inenumerateRefPrefix()and trackNamespaceJanitorResult::has_pending_work. Once aDEFERround settles withchanged_shards == 0, zero non-Livecatalog entries, and a clean janitor sweep, subsequent idle rounds short-circuit when!graduationDue,cas/ref_catalogETag matches, and thecas/ns/stream/fingerprint matches — skippingpre_fold_ref_drain, walk-plan rebuild,namespace_cleanup, and periodic empty folds.CASGCRoundDefer.SteadyStateIdleShortCircuitsWithoutForcedEmptyFoldsAndWakesOnPublishinsrc/Disks/tests/gtest_cas_gc_round_defer.cpp.fold_seal_readsexpectation insrc/Disks/tests/gtest_cas_gc_log.cpp.docs/en/antalya/cas/architecture/garbage-collection.md.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Short-circuit idle CAS GC rounds when the catalog ETag and ref-stream listing fingerprint are unchanged, cache terminal mount ETags and per-round fold seals, and suppress
gc/hbpulses between healthy idle rounds.Documentation entry for user-facing changes
docs/en/antalya/cas/architecture/garbage-collection.md.CI/CD Options
Exclude tests:
Regression jobs to run: