poorbarcode opened a new pull request, #25018:
URL: https://github.com/apache/pulsar/pull/25018

   ### Motivation
   
   When I added the log below with https://github.com/apache/pulsar/pull/24938, 
I assumed the method `ManagedLedgerImpl.comparePositions` will only be executed 
when mark deleting cursors, so a position does not exist should not happen, but 
it is also used when getting metrics. 
   
   The logs that were frequently printed are noisy.
   
   ```
   2025-11-25T11:30:49,286+0000 [pulsar-stats-updater-31-1] WARN 
org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl - 
[public/default/persistent/__transaction_buffer_snapshot-partition-0] Comparing 
un-exist position 57:9 and 421199:-1 java.lang.IllegalArgumentException: 
Comparing un-exist position at 
org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.comparePositions(ManagedLedgerImpl.java:3737)
 at 
org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.getNumberOfEntries(ManagedLedgerImpl.java:3762)
 at 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.getNumberOfEntries(ManagedCursorImpl.java:1754)
 at 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.getNumberOfEntriesInBacklog(ManagedCursorImpl.java:1268)
 at 
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl.getNumberOfEntriesInBacklog(ManagedCursorImpl.java:1279)
 at 
org.apache.pulsar.broker.service.persistent.PersistentSubscription.getNumberOfEntriesInBacklog(PersistentSubscription.java:977)
 at org.apache.pulsar.broker.se
 
rvice.persistent.PersistentTopic.lambda$updateRates$109(PersistentTopic.java:2680)
 at java.base/java.util.concurrent.ConcurrentHashMap.forEach(Unknown Source) at 
org.apache.pulsar.broker.service.persistent.PersistentTopic.updateRates(PersistentTopic.java:2650)
 at 
org.apache.pulsar.broker.service.PulsarStats.lambda$updateStats$1(PulsarStats.java:141)
 at java.base/java.util.concurrent.ConcurrentHashMap.forEach(Unknown Source) at 
org.apache.pulsar.broker.service.PulsarStats.lambda$updateStats$3(PulsarStats.java:138)
 at java.base/java.util.concurrent.ConcurrentHashMap.forEach(Unknown Source) at 
org.apache.pulsar.broker.service.PulsarStats.lambda$updateStats$4(PulsarStats.java:126)
 at java.base/java.util.concurrent.ConcurrentHashMap.forEach(Unknown Source) at 
org.apache.pulsar.broker.service.PulsarStats.updateStats(PulsarStats.java:116) 
at 
org.apache.pulsar.broker.service.BrokerService.updateRates(BrokerService.java:2244)
 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(U
 nknown Source) at 
java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source) at 
org.apache.pulsar.common.util.SingleThreadNonConcurrentFixedRateScheduler$ScheduledFutureTask.run(SingleThreadNonConcurrentFixedRateScheduler.java:371)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 at java.base/java.lang.Thread.run(Unknown Source)
   ```
   
   ### Modifications
   
   Remove the log.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: x


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