Skip to content
Open
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 @@ -105,6 +105,13 @@ public UpsertedConfig writeConfig(
.withDescription("Update failed because upsert condition did not match given record")
.asRuntimeException();
}
} else if (optionalPreviousConfig.isPresent()
&& optionalPreviousConfig.get().getCreationTimestamp() < 1648630400000L) {
// Delete documents older than 2022-04-01, and recreate them with their IDs ending in "latest"
// Since documents before this date don't have "latest" in their _id, they are causing
// duplicate entries.
collection.delete(buildConfigResourceContextsFilter(List.of(configResourceContext)));
collection.upsert(latestDocKey, latestConfigDocument);
} else {
collection.upsert(latestDocKey, latestConfigDocument);
}
Expand Down
Loading