poorbarcode commented on code in PR #19873:
URL: https://github.com/apache/pulsar/pull/19873#discussion_r1145599481


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/ImmutableBucket.java:
##########
@@ -44,7 +45,12 @@
 class ImmutableBucket extends Bucket {
 
     @Setter
-    private volatile 
List<DelayedMessageIndexBucketSnapshotFormat.SnapshotSegment> snapshotSegments;
+    private List<DelayedMessageIndexBucketSnapshotFormat.SnapshotSegment> 
snapshotSegments;
+
+    boolean merging = false;

Review Comment:
   the variable `merging ` should be modified with `volatile.`



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BucketDelayedDeliveryTracker.java:
##########
@@ -341,18 +339,24 @@ public synchronized boolean addMessage(long ledgerId, 
long entryId, long deliver
     private synchronized CompletableFuture<Void> asyncMergeBucketSnapshot() {
         List<ImmutableBucket> values = 
immutableBuckets.asMapOfRanges().values().stream().toList();
         long minNumberMessages = Long.MAX_VALUE;
+        long minScheduleTimestampSum = Long.MAX_VALUE;

Review Comment:
   Is variable `minScheduleTimestampSum` unnecessary?



-- 
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]

Reply via email to