graysonzeng commented on PR #4171:
URL: https://github.com/apache/bookkeeper/pull/4171#issuecomment-1888338104
@lhotari @hangc0276 @eolivelli Thank you very much for your suggestions,
I'll be happy to continue improving it.
> True, but that would be a significant change that could at least cause
performance regressions
1. So we not use the OrderedExecutor, and should synchronized
(pendingAddOps) for serializing drainPendingAddsAndAdjustLength &
sendAddSuccessCallbacks. Is it right? @lhotari
2. make changingEnsemble field volatile.
> add logic to drainPendingAddsAndAdjustLength method to update
pendingAddsSequenceHead accordingly
3. i think like this
```java
synchronized List<PendingAddOp> drainPendingAddsAndAdjustLength() {
PendingAddOp pendingAddOp;
List<PendingAddOp> opsDrained = new
ArrayList<PendingAddOp>(pendingAddOps.size());
while ((pendingAddOp = pendingAddOps.poll()) != null) {
addToLength(-pendingAddOp.entryLength);
opsDrained.add(pendingAddOp);
// new code
pendingAddsSequenceHead = pendingAddOp.entryId;
}
return opsDrained;
}
```
> IMO, the drainPendingAddsAndAdjustLength method also need to be executed
by OrderedExecutor.
After that, we don't need to use OrderedExecutor for
drainPendingAddsAndAdjustLength. Is it right? @hangc0276
> remove the too strict rule for pendingAddsSequenceHead which breaks things
after failures
I'm a little confused about this . Can you tell it more about it? @lhotari
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]