Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix][broker] Fix occur confusing error log when reader readEntry #23023

Closed
wants to merge 4 commits into from

Conversation

TakaHiR07
Copy link
Contributor

@TakaHiR07 TakaHiR07 commented Jul 11, 2024

Main Issue: #23022

Motivation

As shown in the issue. Fix occur confusing error log when use reader to read entry.

Modifications

In the case that read entry failed because cursor is NonDurableCursor and is closed , there is no need to trigger more read operations since the next read operation would directly skip and finish. Just wait for a new NonDurableCursor open and read again.

This is the simplest way I guess to fix the problem. This fix only affect the nonDurableCursor, which would not bring extra issue of durableCursor

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 11, 2024
Comment on lines 530 to 531
log.debug("[{}-{}] Error reading entries at {} : {} - Retrying to read in {} seconds", name, c,
cursor.getReadPosition(), exception.getMessage(), waitTimeMillis / 1000.0);
Copy link
Member

Choose a reason for hiding this comment

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

Is this debug log message correct? I don't think that there's a retry in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

have changed the log message

// since the next read operation would directly skip and finish.
// Just wait for a new NonDurableCursor open and read again.
if (cursor instanceof NonDurableCursorImpl) {
log.debug("[{}-{}] Error reading entries at {} : {}. " +
Copy link
Member

Choose a reason for hiding this comment

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

Please add if (log.isDebugEnabled()) { since exception.getMessage() could have a cost.

@lhotari
Copy link
Member

lhotari commented Oct 12, 2024

Checkstyle error

src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumer.java:[547,76] (whitespace) OperatorWrap: '+' should be on a new line.

@lhotari
Copy link
Member

lhotari commented Oct 14, 2024

It turns out that this is already covered by #22751. Closing this PR.

@lhotari lhotari closed this Oct 14, 2024
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.

2 participants