Skip to content

CASSANDRA-21666 Fix compression dictionary training failing with "insufficient samples" on large-chunk tables - #5131

Closed
smiklosovic wants to merge 2 commits into
apache:trunkfrom
smiklosovic:CASSANDRA-21666-6.0
Closed

smiklosovic wants to merge 2 commits into
apache:trunkfrom
smiklosovic:CASSANDRA-21666-6.0

Conversation

@smiklosovic

Copy link
Copy Markdown
Contributor

Thanks for sending a pull request! Here are some tips if you're new here:

  • Ensure you have added or run the appropriate tests for your PR.
  • Be sure to keep the PR description updated to reflect all changes.
  • Write your PR title to summarize what this PR proposes.
  • If possible, provide a concise example to reproduce the issue for a faster review.
  • Read our contributor guidelines
  • If you're making a documentation change, see our guide to documentation contribution

Commit messages should follow the following format:

<One sentence description, usually Jira title or CHANGES.txt summary>

<Optional lengthier description (context on patch)>

patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####

Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>

The Cassandra Jira

@smiklosovic
smiklosovic requested a review from yifan-c September 8, 2026 12:16

@bbotella bbotella left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

long remainingTarget = Math.min(targetChunkCount - sampleCount, (config.maxTotalSampleSize - totalSampleSize) / info.chunkSize);
long chunksFromThisSSTable = Math.min((targetChunkCount * info.chunkCount) / totalChunks, remainingTarget);
long proportionalChunks = (targetChunkCount * info.chunkCount) / totalChunks;
long chunksFromThisSSTable = Math.min(Math.max(1, proportionalChunks), remainingTarget);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Since it now greedily picks at least 1 chunk based on the list order, how about shuffling the sstableInfos list to preserve the randomness?

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