liuzongliang0202 commented on code in PR #4518:
URL: https://github.com/apache/rocketmq/pull/4518#discussion_r1055253416


##########
store/src/main/java/org/apache/rocketmq/store/index/IndexService.java:
##########
@@ -358,15 +358,21 @@ public void flush(final IndexFile f) {
 
         if (indexMsgTimestamp > 0) {
             
this.defaultMessageStore.getStoreCheckpoint().setIndexMsgTimestamp(indexMsgTimestamp);
-            this.defaultMessageStore.getStoreCheckpoint().flush();
+            if (forceFlush) {
+                this.defaultMessageStore.getStoreCheckpoint().flush();
+            }
         }
     }
 
     public void start() {
 
     }
 
+    // fix issue 4463
     public void shutdown() {
-
+        if (!indexFileList.isEmpty()) {
+            final IndexFile indexFile = indexFileList.get(indexFileList.size() 
- 1);
+            flush(indexFile, false);

Review Comment:
   因为整个shutdown流程中后面有了StoreCheckpoint.flush(),这里就没必要再让checkpoint刷新了



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