Skip to content

Commit

Permalink
Reset repairedAt when receiving sstables
Browse files Browse the repository at this point in the history
We're not using incremental repairs, therefore we want Repaired At to
be set to 0 for all sstables. Some older services still have this value
set to non-zero values from the times when we were using incremental
repairs. This patch should make sure that any new node we bootstrap
has Repaired At set to 0 for all sstables.

This patch should be removed when we release the next minor version
after 4.1.7.
  • Loading branch information
dmitry-potepalov committed Nov 5, 2024
1 parent 59987dc commit 3b527b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ public SSTableMultiWriter read(DataInputPlus in) throws Throwable
}

UnaryOperator<StatsMetadata> transform = stats -> stats.mutateLevel(header.sstableLevel)
.mutateRepairedMetadata(messageHeader.repairedAt, messageHeader.pendingRepair, false);
.mutateRepairedMetadata(0, messageHeader.pendingRepair, false);
String description = String.format("level %s and repairedAt time %s and pendingRepair %s",
header.sstableLevel, messageHeader.repairedAt, messageHeader.pendingRepair);
header.sstableLevel, 0, messageHeader.pendingRepair);
writer.descriptor.getMetadataSerializer().mutate(writer.descriptor, description, transform);
return writer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public CassandraStreamReader(StreamMessageHeader header, CassandraStreamHeader s
this.estimatedKeys = streamHeader.estimatedKeys;
this.sections = streamHeader.sections;
this.inputVersion = streamHeader.version;
this.repairedAt = header.repairedAt;
this.repairedAt = 0;
this.pendingRepair = header.pendingRepair;
this.format = streamHeader.format;
this.sstableLevel = streamHeader.sstableLevel;
Expand Down

0 comments on commit 3b527b1

Please sign in to comment.