Skip to content

perf: Skip download of upgraded segments on historicals#19676

Draft
kfaraz wants to merge 1 commit into
apache:masterfrom
kfaraz:skip_download_upgraded_segments
Draft

perf: Skip download of upgraded segments on historicals#19676
kfaraz wants to merge 1 commit into
apache:masterfrom
kfaraz:skip_download_upgraded_segments

Conversation

@kfaraz

@kfaraz kfaraz commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Add nullable field upgradedFromSegmentId to DataSegment
  • This field already exists in DataSegmentPlus but the object sent over the wire to historicals in a load request is a plain DataSegment (or actually a LoadableDataSegment)
  • Update SegmentLocalCacheManager to copy files from base directory to actual directory

Pending items

  • Complete self review
  • Wire up the population of the upgradedFromSegmentId column (it might already be happening, atleast in the incremental cache)
  • Add unit/embedded tests

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@kfaraz kfaraz marked this pull request as draft July 10, 2026 15:33
}
if (needsLoad) {
loadInLocationWithStartMarker(dataSegment, storageDir);
final File baseDir = findCachedBaseSegmentDir(mountLocation);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This doesn't seem correct, the base segment could be in some other location too.

* {@link #loadInLocationWithStartMarker}.
*/
@GuardedBy("entryLock")
private void copyFromBaseSegmentDir(final File baseDir, final File destDir)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This method needs to hold the entryLock for the base segment too.

@kfaraz kfaraz requested a review from clintropolis July 10, 2026 15:59
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