You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "iloveeyjafjalla (via GitHub)" <gi...@apache.org> on 2026/10/19 04:17:29 UTC

[I] [Bug] The checkpoint crc mismatch message prints a checksum where the file name belongs [rocketmq]

iloveeyjafjalla opened a new issue, #11452:
URL: https://github.com/apache/rocketmq/issues/11452

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open issues](https://github.com/apache/rocketmq/issues) of this repository and believe that this is not a duplicate.
   - [x] This is a defect in Apache RocketMQ, not a usage question.
   - [x] I can reproduce this on the current `develop` branch.
   
   ### RocketMQ Version
   
   develop @ `5d68880cbdfa5c6d87b5681c5eb3684df0e18ef8` (the revision this was verified on)
   
   ### Describe the Bug
   
   When a checkpoint file's stored crc32 does not match its content, `CheckpointFile.read` throws an `IOException` that names the wrong value:
   
   ```java
   if (NOT_CHECK_CRC_MAGIC_CODE != expectedCrc32 && truthCrc32 != expectedCrc32) {
       final String err = String.format(
           "Entries crc32 not match, file=%s, truth=%s", expectedCrc32, truthCrc32);
       throw new IOException(err);
   }
   ```
   
   `file=%s` is filled with `expectedCrc32`, so an operator who opens a corrupted checkpoint (epoch checkpoint, timer checkpoint, ...) reads e.g.
   
   ```
   Entries crc32 not match, file=823222925, truth=823222924
   ```
   
   - the value after `file=` is a **checksum**, not the path that failed to load;
   - the expected checksum is never labelled, so the two numbers can only be told apart by guessing which is which.
   
   The path is right there in `read(String filePath)` when the message is built, so the diagnostic can name the file and label the expected value.
   
   ### Steps to Reproduce
   
   1. Write a checkpoint through `CheckpointFile.write(entries)`.
   2. Change the stored crc32 line (the second line) so it no longer matches the content, for both the checkpoint and its `.bak` fallback.
   3. Call `CheckpointFile.read()` and read the exception message:
   
   ```
   Entries crc32 not match, file=823222925, truth=823222924
   ```
   
   The same point is made by the test added with the fix (`CheckpointFileTest#testCrcMismatchReportsTheFileAndTheExpectedCrc`, in the `remoting` module where the checkpoint test already lives).
   
   ### What Did You Expect to See?
   
   The message names the file that failed to load and labels both checksums, e.g.
   
   ```
   Entries crc32 not match, file=/tmp/store-test/epoch.ckpt.bak, expected=823222925, truth=823222924
   ```
   
   ### What Did You See Instead?
   
   `file=` carries a checksum and the expected checksum has no label, so the diagnostic cannot be read without knowing the implementation.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] The checkpoint crc mismatch message prints a checksum where the file name belongs [rocketmq]

Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin closed issue #11452: [Bug] The checkpoint crc mismatch message prints a checksum where the file name belongs
URL: https://github.com/apache/rocketmq/issues/11452


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] The checkpoint crc mismatch message prints a checksum where the file name belongs [rocketmq]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #11452:
URL: https://github.com/apache/rocketmq/issues/11452#issuecomment-6260061551

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase (`develop` branch).
   
   **Root Cause:** In `CheckpointFile.read(String filePath)`, the CRC mismatch error message uses `expectedCrc32` (an integer) for the `file=%s` format placeholder instead of the `filePath` parameter that is already in scope. This makes the diagnostic output misleading — operators see a checksum where they expect a file path.
   
   **Location:** `common/src/main/java/org/apache/rocketmq/common/utils/CheckpointFile.java`, line ~113-116
   
   **Impact:** Affects all checkpoint file types (epoch, timer, etc.) when CRC corruption occurs. Operators cannot identify which file is corrupted from the error message alone.
   
   **Severity:** Low — diagnostic/logging issue only, no functional impact on message processing.
   
   **Suggested Fix:** Change the format string to include `filePath` and label both checksums:
   ```java
   "Entries crc32 not match, file=%s, expected=%s, truth=%s", filePath, expectedCrc32, truthCrc32
   ```
   
   An automated fix proposal will be generated. Reply `/approve` to proceed with PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org