jrwest commented on code in PR #3751:
URL: https://github.com/apache/cassandra/pull/3751#discussion_r1915340814
##########
src/java/org/apache/cassandra/service/snapshot/TableSnapshot.java:
##########
@@ -490,8 +496,110 @@ private void loadMetadataFromManifest(File manifestFile)
TableSnapshot build()
{
+ maybeCreateOrEnrichManifest();
return new TableSnapshot(keyspaceName, tableName, tableId, tag,
createdAt, expiresAt, snapshotDirs, ephemeral);
}
+
+ private void maybeCreateOrEnrichManifest()
+ {
+ boolean oldManifestExists = false;
+
+ if
(!CassandraRelevantProperties.SNAPSHOT_MANIFEST_ENRICH_OR_CREATE_ENABLED.getBoolean())
+ return;
+
+ // this is caused by not reading any manifest or that snapshot had
a basic manifest just with sstables
+ // enumerated (pre CASSANDRA-16789), so we just go ahead and
enrich it in each snapshot dir
+
+ if (createdAt != null)
+ return;
+
+ for (File snapshotDir : snapshotDirs)
+ {
+ File maybeManifest = new
File(snapshotDir.toPath().resolve("manifest.json"));
+ if (maybeManifest.exists())
+ {
+ oldManifestExists = true;
+ break;
+ }
+ }
+
+ if (oldManifestExists)
+ logger.debug("Manifest in the old format for snapshot {} was
detected, going to enrich it.", this);
Review Comment:
Personally would prefer to see this logged at `info`. It happens very
infrequently so its not a noise risk and its useful to know this is happening
for the operator imo.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]