yx9o commented on code in PR #11405:
URL: https://github.com/apache/rocketmq/pull/11405#discussion_r4786175346
##########
broker/src/main/java/org/apache/rocketmq/broker/pop/PopConsumerService.java:
##########
@@ -797,18 +799,58 @@ public synchronized void transferToFsStore() {
int reviveQueueId = (int) record.getOffset() %
brokerConfig.getReviveQueueNum();
MessageExtBrokerInner ckMsg =
brokerController.getPopMessageProcessor().buildCkMsg(ck, reviveQueueId);
-
brokerController.getMessageStore().asyncPutMessage(ckMsg).join();
+ if (putCkToFsStore(ckMsg, record)) {
+ transferredRecords.add(record);
+ }
+ }
+ if (transferredRecords.isEmpty()) {
+ // No checkpoint was persisted this round. Keep the
records in the kv store so the
+ // popped-but-unacked messages stay revivable and the
transfer can be re-run,
+ // instead of spinning on the same failing batch inside
this synchronized method.
+ log.error("PopConsumerStore transfer from kvStore to
fsStore made no progress, " +
+ "records stay in kvStore, count={}",
consumerRecords.size());
+ break;
Review Comment:
This `break` leaves untransferred records in the KV store, but
`transferPopToFsStore()` returns `SUCCESS` when the method returns normally, so
`exportPopRecord` reports no error. Can we propagate an incomplete-transfer
status so operators know to retry before switching stores?
--
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]