Skip to content

feat: partial load rules assignment prefer in-place reload over fresh load - #20267

Open
clintropolis wants to merge 1 commit into
apache:masterfrom
clintropolis:prefer-in-place-partial-load
Open

feat: partial load rules assignment prefer in-place reload over fresh load#20267
clintropolis wants to merge 1 commit into
apache:masterfrom
clintropolis:prefer-in-place-partial-load

Conversation

@clintropolis

@clintropolis clintropolis commented Sep 5, 2026

Copy link
Copy Markdown
Member

Description

Updates PartialSegmentStatusInTier and StrategicSegmentAssigner to prefer in-place reloads of partial segments rather than load-then-drop to another server.

The reason it was like this is because partial load rules were introduced before historicals could actually honor them (partial loading was still work in progress), and my design at the time meant that they would only do an additive load on rule change. However the functionality that got actually merged (#19671) ended up having the rules using internal holds on the weak references that make up a partially loaded segment in cache, so a rule change is not just additive (we load any missing bundles, and release the holds on any bundles no longer pinned by rules, allowing them to be evicted).

This means that there is no downside to doing an in-place reload, only positives since it only has to download the difference rather than the whole set, so this PR flips the priority to do fresh load as the fallback behavior.

* {@link #getEligibleForFreshLoad()}. See {@link StrategicSegmentAssigner#updateReplicasInTierPartial}.
*/
public List<ServerHolder> getEligibleForAdditiveReload()
public List<ServerHolder> getEligibleForInPlaceReload()

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Severity Findings
P0 0
P1 1
P2 0
P3 0
Total 1
Severity Findings
P0 0
P1 1
P2 0
P3 0
Total 1

Reviewed 5 of 5 changed files.


This is an automated review by Codex GPT-5.6-Luna(max)

final Iterator<ServerHolder> destinations = Iterators.concat(
serversToLoadSegment(segment, tier, freshCandidates),
status.getEligibleForAdditiveReload().iterator()
int numLoadsQueued = queuePartialLoads(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] Preserve the serving replica when an in-place reload fails

This now queues an in-place reload before trying any empty server, but a failed loadPartial is handled by SegmentLoadDropHandler.addSegment as a failed segment load: it unannounces and drops the existing segment. Failures are possible here (for example, the old cache entry is held or the new partial bundles cannot be reserved), and canReloadInPlace intentionally does not check disk capacity. With one stale replica and a viable empty server, this can remove the only serving copy even though the previous fresh-first path would have kept it serving while the replacement loaded. Preserve or roll back the old replica, or fall back to a fresh destination when the in-place load cannot proceed, and add a failure-with-fresh-candidate test.

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.

3 participants