-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve][log] Print ZK path if write to ZK fails due to data being too large to persist #23652
base: master
Are you sure you want to change the base?
Conversation
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Outdated
Show resolved
Hide resolved
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Outdated
Show resolved
Hide resolved
@poorbarcode One small detail about the PR titles. Please don't add a space between the 2 prefixes. Instead of |
List<Pair> opsForLog = ops.stream().map(op -> Pair.of(op.getPath(), op.size())) | ||
.collect(Collectors.toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this list is only for logging, I think it would be more useful to build a String directly in the desired format. It might be good to limit how many entries are logged and split to multiple log messages in case there could be a large amount of ops. Is the size of the String going to be a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
java.util.StringJoiner
(or Collectors.joining
) could be used instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a filter op -> op.size > 256K
Motivation & Modifications
Improvement 1
We can hardly find the ZK node when encountering the above error.
Improvement 2
There is a mechanism that persists cursor ack info into ZK if it matches the two conditions:
But it will print
Error while using MetaStore, try to persist the position...
even if it will not write ZK because there are still messages to consume.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: x