Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #8549] Ipv6 enabled in broker, pickupStoreTimestamp size should be 20 #8567

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Supplier;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.validator.routines.InetAddressValidator;
import org.apache.rocketmq.common.AbstractBrokerRunnable;
import org.apache.rocketmq.common.BoundaryType;
import org.apache.rocketmq.common.BrokerConfig;
Expand Down Expand Up @@ -1178,7 +1179,11 @@ public long getEarliestMessageTime() {
if (this.getCommitLog() instanceof DLedgerCommitLog) {
minPhyOffset += DLedgerEntry.BODY_OFFSET;
}
final int size = MessageDecoder.MESSAGE_STORE_TIMESTAMP_POSITION + 8;
int size = MessageDecoder.MESSAGE_STORE_TIMESTAMP_POSITION + 8;
InetAddressValidator validator = InetAddressValidator.getInstance();
if (validator.isValidInet6Address(this.brokerConfig.getBrokerIP1())) {
size = MessageDecoder.MESSAGE_STORE_TIMESTAMP_POSITION + 20;
}
return this.getCommitLog().pickupStoreTimestamp(minPhyOffset, size);
}

Expand Down
Loading