Skip to content

Conversation

driftx
Copy link

@driftx driftx commented Sep 16, 2025

What is the issue

Very long log lines can be produced during commitlog replay

What does this PR fix and why was it fixed

Limits the amount of information printed at debug, but retains full information at trace

Copy link

Checklist before you submit for review

  • This PR adheres to the Definition of Done
  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits
  • All new files should contain the DataStax copyright header instead of the Apache License one

if (skippedSSTables.size() <= maxSSTablesToLog) {
logger.debug("Ignored commitLogIntervals from the following sstables: {}", skippedSSTables);
} else {
List<String> sample = new ArrayList<>(skippedSSTables).subList(0, maxSSTablesToLog);

Choose a reason for hiding this comment

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

nit:
if the number of sstables is very big this is going to create a big ArrayList, maybe we can do it the same way you did in "construct": iterate and keep the first N

Copy link
Author

Choose a reason for hiding this comment

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

Good point! Updated.

Copy link

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

I have left a small comment.

I don't think it is worth to add a unit test for this.
it would be pretty tricky to setup, I don't know if we have facilities to intercept the logs. I find it overkill

@driftx
Copy link
Author

driftx commented Sep 16, 2025

I thought about that too and came to the same conclusion.

// Limit the number of SSTable names logged to prevent massive log lines
int maxSSTablesToLog = 100;
if (skippedSSTables.size() <= maxSSTablesToLog) {
logger.debug("Ignored commitLogIntervals from the following sstables: {}", skippedSSTables);
Copy link

Choose a reason for hiding this comment

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

I was wondering: Do we always hit this in CNDB replayer? If yes, is there a way we can turn the log off if it's not useful?

Copy link
Author

Choose a reason for hiding this comment

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

If we don't want them just in CNDB, we should be able to suppress them with logback. If you'd prefer that I can do it in a different PR.

Copy link
Author

Choose a reason for hiding this comment

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

actually I think we'd have to suppress all the logs from CommitLogReplayer if we do it though logback.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
52.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@cassci-bot
Copy link

✔️ Build ds-cassandra-pr-gate/PR-2001 approved by Butler


Approved by Butler
See build details here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants