Fix metric messagesConsumedCounter calculation error
Motivation
Fix metric messagesConsumedCounter calculation error. In the ManagedCursorImpl#setAcknowledgedPosition method, we will calculate skippedEntries based on newMarkDeletePosition and oldMarkDeletePosition, and then accumulate skippedEntries into MSG_CONSUMED_COUNTER_UPDATER: MSG_CONSUMED_COUNTER_UPDATER.addAndGet(this, skippedEntries); But the newMarkDeletePosition here is not the final value, newMarkDeletePosition may change between calculating skippedEntries and accumulating to MSG_CONSUMED_COUNTER_UPDATER: https://github.com/apache/pulsar/blob/bf6e815767c89512e0689562fbba0c2c453ff081/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L1769-L1802
Modifications
Therefore, skippedEntries should only be calculated after newMarkDeletePosition has changed:

Documentation
-
[ ]
doc-required(Your PR needs to update docs and you will update later) -
[x]
doc-not-needed(Please explain why) -
[ ]
doc(Your PR contains doc changes) -
[ ]
doc-complete(Docs have been already added)
/pulsarbot run-failure-checks
@lordcheng10 Is it possible to add an unit test?
OK