Skip to content
Merged
Show file tree
Hide file tree
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 @@ -407,6 +407,7 @@ private RaftProperties newRaftProperties(ConfigurationSource conf) {
StorageUnit.BYTES);
RaftServerConfigKeys.Log.setSegmentSizeMax(properties,
SizeInBytes.valueOf(raftSegmentSize));
RaftServerConfigKeys.Log.setPurgeUptoSnapshotIndex(properties, true);

// Set RAFT segment pre-allocated size
final int raftSegmentPreallocatedSize = (int) conf.getStorageSize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,21 +363,11 @@ public long takeSnapshot() throws IOException {
public CompletableFuture<TermIndex> notifyInstallSnapshotFromLeader(
RaftProtos.RoleInfoProto roleInfoProto, TermIndex firstTermIndexInLog) {

String leaderNodeId = RaftPeerId.valueOf(roleInfoProto.getSelf().getId())
.toString();

LOG.info("Received install snapshot notificaiton form OM leader: {} with " +
String leaderNodeId = RaftPeerId.valueOf(roleInfoProto.getFollowerInfo()
.getLeaderInfo().getId().getId()).toString();
LOG.info("Received install snapshot notification from OM leader: {} with " +
"term index: {}", leaderNodeId, firstTermIndexInLog);

if (!roleInfoProto.getRole().equals(RaftProtos.RaftPeerRole.LEADER)) {
// A non-leader Ratis server should not send this notification.
LOG.error("Received Install Snapshot notification from non-leader OM " +
"node: {}. Ignoring the notification.", leaderNodeId);
return completeExceptionally(new OMException("Received notification to " +
"install snaphost from non-leader OM node",
OMException.ResultCodes.RATIS_ERROR));
}

CompletableFuture<TermIndex> future = CompletableFuture.supplyAsync(
() -> ozoneManager.installSnapshotFromLeader(leaderNodeId),
installSnapshotExecutor);
Expand Down