Skip to content

The beginTimestamp can be updated to second Index data #4247

@Oliverwqcwrw

Description

@Oliverwqcwrw

BUG REPORT

  1. Please describe the issue you observed:

In org.apache.rocketmq.store.index.IndexFile#putKey

if (this.indexHeader.getIndexCount() <= 1) {
this.indexHeader.setBeginPhyOffset(phyOffset);
this.indexHeader.setBeginTimestamp(storeTimestamp);
}

When the second message is added to the IndexFile, beginPhyOffset and beginTimestamp will still be updated because it satisfies indexCount less than or equal to 1

  • What is expected to see?

if (this.indexHeader.getIndexCount() < 1) {
this.indexHeader.setBeginPhyOffset(phyOffset);
this.indexHeader.setBeginTimestamp(storeTimestamp);
}

  1. Please tell us about your environment:

version:4.9.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions