Skip to content

Commit

Permalink
Fix NodeStats bwc tests..
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 committed Mar 2, 2023
1 parent 3f9d1f3 commit 51e9fb2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,6 @@ public NodeStats(StreamInput in) throws IOException {
}
indexingPressureStats = in.readOptionalWriteable(IndexingPressureStats::new);
shardIndexingPressureStats = in.readOptionalWriteable(ShardIndexingPressureStats::new);

if (in.getVersion().onOrAfter(Version.V_2_7_0)) {
segmentReplicationStats = in.readOptionalWriteable(SegmentReplicationStats::new);
} else {
segmentReplicationStats = null;
}

if (in.getVersion().onOrAfter(Version.V_2_4_0)) {
searchBackpressureStats = in.readOptionalWriteable(SearchBackpressureStats::new);
} else {
Expand All @@ -191,6 +184,11 @@ public NodeStats(StreamInput in) throws IOException {
} else {
fileCacheStats = null;
}
if (in.getVersion().onOrAfter(Version.V_3_0_0) && FeatureFlags.isEnabled(FeatureFlags.REPLICATION_TYPE)) {
segmentReplicationStats = in.readOptionalWriteable(SegmentReplicationStats::new);
} else {
segmentReplicationStats = null;
}
}

public NodeStats(
Expand Down Expand Up @@ -398,10 +396,6 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalWriteable(indexingPressureStats);
out.writeOptionalWriteable(shardIndexingPressureStats);

if (out.getVersion().onOrAfter(Version.V_2_7_0)) {
out.writeOptionalWriteable(segmentReplicationStats);
}

if (out.getVersion().onOrAfter(Version.V_2_4_0)) {
out.writeOptionalWriteable(searchBackpressureStats);
}
Expand All @@ -414,6 +408,9 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_3_0_0) && FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT)) {
out.writeOptionalWriteable(fileCacheStats);
}
if (out.getVersion().onOrAfter(Version.V_3_0_0) && FeatureFlags.isEnabled(FeatureFlags.REPLICATION_TYPE)) {
out.writeOptionalWriteable(segmentReplicationStats);
}
}

@Override
Expand Down Expand Up @@ -486,9 +483,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
if (getShardIndexingPressureStats() != null) {
getShardIndexingPressureStats().toXContent(builder, params);
}
if (getSegmentReplicationStats() != null) {
getSegmentReplicationStats().toXContent(builder, params);
}
if (getSearchBackpressureStats() != null) {
getSearchBackpressureStats().toXContent(builder, params);
}
Expand All @@ -501,7 +495,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
if (getFileCacheStats() != null && FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT)) {
getFileCacheStats().toXContent(builder, params);
}

if (getSegmentReplicationStats() != null && FeatureFlags.isEnabled(FeatureFlags.REPLICATION_TYPE)) {
getSegmentReplicationStats().toXContent(builder, params);
}
return builder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ public synchronized void updateVisibleCheckpointForShard(final String allocation
});
cps.lastCompletedReplicationLag = lastFinished.get();
}
logger.info(
logger.trace(
() -> new ParameterizedMessage(
"updated local knowledge for [{}] on the primary of the visible checkpoint from [{}] to [{}], active timers {}",
allocationId,
Expand Down Expand Up @@ -1222,7 +1222,7 @@ public synchronized void setLatestReplicationCheckpoint(ReplicationCheckpoint ch
replicationTimer.start();
return replicationTimer;
});
logger.info(
logger.trace(
() -> new ParameterizedMessage(
"updated last published checkpoint to {} - timers [{}]",
checkpoint,
Expand Down

0 comments on commit 51e9fb2

Please sign in to comment.