Skip to content

fix: preserve DimensionValueSetShardSpec on upgraded append segments#19615

Merged
abhishekrb19 merged 1 commit into
apache:masterfrom
abhishekrb19:dim_values_set_compact_fix
Jun 22, 2026
Merged

fix: preserve DimensionValueSetShardSpec on upgraded append segments#19615
abhishekrb19 merged 1 commit into
apache:masterfrom
abhishekrb19:dim_values_set_compact_fix

Conversation

@abhishekrb19

Copy link
Copy Markdown
Contributor

With #19571, when a concurrent replace task
upgrades a still-appending streaming task, the upgraded (new-version) copy of
each append segment previously adopted the pending segment's plain NumberedShardSpec,
dropping the DimensionValueSetShardSpec stamped at publish time. This made upgraded
segments unprunable by the broker.

The upgraded copy now takes its partition number and core-partition count
from the pending segment while carrying forward the original segment's
partitionDimensionValues when it is a DimensionValueSetShardSpec. The
value-set guarantee holds because the upgraded copy serves the same rows
as the original append segment.

This does not change the fact that pending segments are always allocated as numbered
shard specs, since tasks still advertise them as such — the value-set shard spec
currently applies only to recently-published segments.

This PR has:

  • been self-reviewed.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • been tested in a test Druid cluster.

  When a concurrent REPLACE upgrades a still-appending streaming task, the
  upgraded (new-version) copy of each append segment previously adopted the
  pending segment's plain NumberedShardSpec, dropping the
  DimensionValueSetShardSpec stamped at publish time. This made upgraded
  segments unprunable by the broker.

  The upgraded copy now takes its partition number and core-partition count
  from the pending segment while carrying forward the original segment's
  partitionDimensionValues when it is a DimensionValueSetShardSpec. The
  value-set guarantee holds because the upgraded copy serves the same rows
  as the original append segment.
@abhishekrb19
abhishekrb19 merged commit a289901 into apache:master Jun 22, 2026
38 checks passed
@abhishekrb19
abhishekrb19 deleted the dim_values_set_compact_fix branch June 22, 2026 22:44
@github-actions github-actions Bot added this to the 38.0.0 milestone Jun 22, 2026
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