heesung-sn commented on code in PR #19620:
URL: https://github.com/apache/pulsar/pull/19620#discussion_r1119040503
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/channel/ServiceUnitStateCompactionStrategy.java:
##########
@@ -50,14 +50,19 @@ public void checkBrokers(boolean check) {
public boolean shouldKeepLeft(ServiceUnitStateData from,
ServiceUnitStateData to) {
if (to == null) {
return false;
- } else if (to.force()) {
- return false;
}
+ // Skip the compaction case where from = null and to.versionId > 1
+ if (from != null && from.versionId() + 1 != to.versionId()) {
+ return true;
+ }
Review Comment:
Can you give an example here?
If a bundle state change is compacted, the prev will be null, and any
invalid states should be ignored by the strategic compaction. This also means
that if prev is null(compacted), we always accept the first transition after
compaction(since the previous history has been compacted)
before compact: [versionIds]
1,2a,2b,2c
//lets say 2b is the first valid transition from 1 and selected in the
strategic compaction.
Then,
after compact:
null,2b,3 ...
--
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]