From 2a7f73ddb574d7cff275c7dcac014158957247ae Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Tue, 19 Oct 2021 13:05:34 +0200 Subject: [PATCH] Optimize SLM Policy Queries (#79341) (#79446) Same as #79321 but for SLM policies. Enhances RepositoryData accordingly to enable the optimization. --- .../s3/S3BlobStoreRepositoryTests.java | 3 +- .../CorruptedBlobStoreRepositoryIT.java | 2 +- .../get/TransportGetSnapshotsAction.java | 96 ++++++++++++++----- .../repositories/RepositoryData.java | 42 ++++++-- .../blobstore/BlobStoreRepository.java | 82 +++++++++------- .../repositories/RepositoryDataTests.java | 18 ++-- .../blobstore/BlobStoreRepositoryTests.java | 8 +- .../xpack/ccr/repository/CcrRepository.java | 3 +- 8 files changed, 180 insertions(+), 74 deletions(-) diff --git a/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java b/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java index 11deffb908528..3f8ceb3290e60 100644 --- a/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java +++ b/plugins/repository-s3/src/internalClusterTest/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java @@ -156,7 +156,8 @@ public void testEnforcedCooldownPeriod() throws IOException { SnapshotState.SUCCESS, SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION.minimumCompatibilityVersion(), 0L, // -1 would refresh RepositoryData and find the real version - 0L // -1 would refresh RepositoryData and find the real version + 0L, // -1 would refresh RepositoryData and find the real version, + "" // null would refresh RepositoryData and find the real version ))); final BytesReference serialized = BytesReference.bytes(modifiedRepositoryData.snapshotsToXContent(XContentFactory.jsonBuilder(), SnapshotsService.OLD_SNAPSHOT_FORMAT)); diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CorruptedBlobStoreRepositoryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CorruptedBlobStoreRepositoryIT.java index b41298d343d64..55066c96aba27 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CorruptedBlobStoreRepositoryIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/CorruptedBlobStoreRepositoryIT.java @@ -330,7 +330,7 @@ public void testHandlingMissingRootLevelSnapshotMetadata() throws Exception { .collect( Collectors.toMap( SnapshotId::getUUID, - s -> new RepositoryData.SnapshotDetails(repositoryData.getSnapshotState(s), null, -1, -1) + s -> new RepositoryData.SnapshotDetails(repositoryData.getSnapshotState(s), null, -1, -1, null) ) ), Collections.emptyMap(), diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java index c819ae73e0ae8..a00b9f1143758 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java @@ -672,7 +672,7 @@ private static Predicate buildAfterPredicate( } } - private static Predicate filterBySLMPolicies(String[] slmPolicies) { + private static SnapshotPredicate filterBySLMPolicies(String[] slmPolicies) { final List includePatterns = new ArrayList<>(); final List excludePatterns = new ArrayList<>(); boolean seenWildcard = false; @@ -692,25 +692,47 @@ private static Predicate filterBySLMPolicies(String[] slmPolicies) final String[] includes = includePatterns.toArray(Strings.EMPTY_ARRAY); final String[] excludes = excludePatterns.toArray(Strings.EMPTY_ARRAY); final boolean matchWithoutPolicy = matchNoPolicy; - return snapshotInfo -> { - final Map metadata = snapshotInfo.userMetadata(); - final String policy; - if (metadata == null) { - policy = null; - } else { - final Object policyFound = metadata.get(SnapshotsService.POLICY_ID_METADATA_FIELD); - policy = policyFound instanceof String ? (String) policyFound : null; - } - if (policy == null) { - return matchWithoutPolicy; + return new SnapshotPredicate() { + @Override + public boolean matchesPreflight(SnapshotId snapshotId, RepositoryData repositoryData) { + final RepositoryData.SnapshotDetails details = repositoryData.getSnapshotDetails(snapshotId); + final String policy; + if (details == null || (details.getSlmPolicy() == null)) { + // no SLM policy recorded + return true; + } else { + final String policyFound = details.getSlmPolicy(); + // empty string means that snapshot was not created by an SLM policy + policy = policyFound.isEmpty() ? null : policyFound; + } + return matchPolicy(includes, excludes, matchWithoutPolicy, policy); } - if (Regex.simpleMatch(includes, policy) == false) { - return false; + + @Override + public boolean matches(SnapshotInfo snapshotInfo) { + final Map metadata = snapshotInfo.userMetadata(); + final String policy; + if (metadata == null) { + policy = null; + } else { + final Object policyFound = metadata.get(SnapshotsService.POLICY_ID_METADATA_FIELD); + policy = policyFound instanceof String ? (String) policyFound : null; + } + return matchPolicy(includes, excludes, matchWithoutPolicy, policy); } - return excludes.length == 0 || Regex.simpleMatch(excludes, policy) == false; }; } + private static boolean matchPolicy(String[] includes, String[] excludes, boolean matchWithoutPolicy, @Nullable String policy) { + if (policy == null) { + return matchWithoutPolicy; + } + if (Regex.simpleMatch(includes, policy) == false) { + return false; + } + return excludes.length == 0 || Regex.simpleMatch(excludes, policy) == false; + } + private static Predicate filterByLongOffset(ToLongFunction extractor, long after, SortOrder order) { return order == SortOrder.ASC ? info -> after <= extractor.applyAsLong(info) : info -> after >= extractor.applyAsLong(info); } @@ -765,19 +787,23 @@ private static final class SnapshotPredicates { Predicate snapshotPredicate = null; final String[] slmPolicies = request.policies(); final String fromSortValue = request.fromSortValue(); + BiPredicate preflightPredicate = null; if (slmPolicies.length > 0) { - snapshotPredicate = filterBySLMPolicies(slmPolicies); + final SnapshotPredicate predicate = filterBySLMPolicies(slmPolicies); + snapshotPredicate = predicate::matches; + preflightPredicate = predicate::matchesPreflight; } final GetSnapshotsRequest.SortBy sortBy = request.sort(); final SortOrder order = request.order(); if (fromSortValue == null) { - preflightPredicate = null; + this.preflightPredicate = preflightPredicate; } else { final Predicate fromSortValuePredicate; + final BiPredicate preflightPred; switch (sortBy) { case START_TIME: final long after = Long.parseLong(fromSortValue); - preflightPredicate = order == SortOrder.ASC ? (snapshotId, repositoryData) -> { + preflightPred = order == SortOrder.ASC ? (snapshotId, repositoryData) -> { final long startTime = getStartTime(snapshotId, repositoryData); return startTime == -1 || after <= startTime; } : (snapshotId, repositoryData) -> { @@ -787,14 +813,14 @@ private static final class SnapshotPredicates { fromSortValuePredicate = filterByLongOffset(SnapshotInfo::startTime, after, order); break; case NAME: - preflightPredicate = order == SortOrder.ASC + preflightPred = order == SortOrder.ASC ? (snapshotId, repositoryData) -> fromSortValue.compareTo(snapshotId.getName()) <= 0 : (snapshotId, repositoryData) -> fromSortValue.compareTo(snapshotId.getName()) >= 0; fromSortValuePredicate = null; break; case DURATION: final long afterDuration = Long.parseLong(fromSortValue); - preflightPredicate = order == SortOrder.ASC ? (snapshotId, repositoryData) -> { + preflightPred = order == SortOrder.ASC ? (snapshotId, repositoryData) -> { final long duration = getDuration(snapshotId, repositoryData); return duration == -1 || afterDuration <= duration; } : (snapshotId, repositoryData) -> { @@ -805,22 +831,22 @@ private static final class SnapshotPredicates { break; case INDICES: final int afterIndexCount = Integer.parseInt(fromSortValue); - preflightPredicate = order == SortOrder.ASC + preflightPred = order == SortOrder.ASC ? (snapshotId, repositoryData) -> afterIndexCount <= indexCount(snapshotId, repositoryData) : (snapshotId, repositoryData) -> afterIndexCount >= indexCount(snapshotId, repositoryData); fromSortValuePredicate = null; break; case REPOSITORY: // already handled in #maybeFilterRepositories - preflightPredicate = null; + preflightPred = null; fromSortValuePredicate = null; break; case SHARDS: - preflightPredicate = null; + preflightPred = null; fromSortValuePredicate = filterByLongOffset(SnapshotInfo::totalShards, Integer.parseInt(fromSortValue), order); break; case FAILED_SHARDS: - preflightPredicate = null; + preflightPred = null; fromSortValuePredicate = filterByLongOffset(SnapshotInfo::failedShards, Integer.parseInt(fromSortValue), order); break; default: @@ -832,6 +858,15 @@ private static final class SnapshotPredicates { } else if (fromSortValuePredicate != null) { snapshotPredicate = fromSortValuePredicate.and(snapshotPredicate); } + if (preflightPredicate == null) { + this.preflightPredicate = preflightPred; + } else { + if (preflightPred != null) { + this.preflightPredicate = preflightPredicate.and(preflightPred); + } else { + this.preflightPredicate = preflightPredicate; + } + } } this.snapshotPredicate = snapshotPredicate; } @@ -848,6 +883,19 @@ public BiPredicate preflightPredicate() { } + private interface SnapshotPredicate { + + /** + * Checks if a snapshot matches the predicate by testing its {@link SnapshotId} for a given {@link RepositoryData}. + */ + boolean matchesPreflight(SnapshotId snapshotId, RepositoryData repositoryData); + + /** + * Checks if a snapshot matches the predicate by testing its {@link SnapshotInfo}. + */ + boolean matches(SnapshotInfo snapshotInfo); + } + private static final class SnapshotsInRepo { private final List snapshotInfos; diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java b/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java index 8730e9038788a..b327720f4eeab 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java @@ -282,7 +282,8 @@ public boolean hasMissingDetails(SnapshotId snapshotId) { return snapshotDetails == null || snapshotDetails.getVersion() == null || snapshotDetails.getStartTimeMillis() == -1 - || snapshotDetails.getEndTimeMillis() == -1; + || snapshotDetails.getEndTimeMillis() == -1 + || snapshotDetails.getSlmPolicy() == null; } /** @@ -638,6 +639,7 @@ public Map resolveNewIndices(List indicesToResolve, Map private static final String MIN_VERSION = "min_version"; private static final String START_TIME_MILLIS = "start_time_millis"; private static final String END_TIME_MILLIS = "end_time_millis"; + private static final String SLM_POLICY = "slm_policy"; /** * Writes the snapshots metadata and the related indices metadata to x-content. @@ -724,6 +726,9 @@ public XContentBuilder snapshotsToXContent(final XContentBuilder builder, final if (snapshotDetails.getEndTimeMillis() != -1) { builder.field(END_TIME_MILLIS, snapshotDetails.getEndTimeMillis()); } + if (snapshotDetails.getSlmPolicy() != null) { + builder.field(SLM_POLICY, snapshotDetails.getSlmPolicy()); + } builder.endObject(); } @@ -890,6 +895,7 @@ private static void parseSnapshots( Version version = null; long startTimeMillis = -1; long endTimeMillis = -1; + String slmPolicy = null; while (parser.nextToken() != XContentParser.Token.END_OBJECT) { String currentFieldName = parser.currentName(); parser.nextToken(); @@ -917,12 +923,14 @@ private static void parseSnapshots( assert endTimeMillis == -1; endTimeMillis = parser.longValue(); break; + case SLM_POLICY: + slmPolicy = stringDeduplicator.computeIfAbsent(parser.text(), Function.identity()); } } assert (startTimeMillis == -1) == (endTimeMillis == -1) : "unexpected: " + startTimeMillis + ", " + endTimeMillis + ", "; final SnapshotId snapshotId = new SnapshotId(name, uuid); if (state != null || version != null) { - snapshotsDetails.put(uuid, new SnapshotDetails(state, version, startTimeMillis, endTimeMillis)); + snapshotsDetails.put(uuid, new SnapshotDetails(state, version, startTimeMillis, endTimeMillis, slmPolicy)); } snapshots.put(uuid, snapshotId); if (metaGenerations != null && metaGenerations.isEmpty() == false) { @@ -1036,7 +1044,7 @@ private static String parseLegacySnapshotUUID(XContentParser parser) throws IOEx */ public static class SnapshotDetails { - public static SnapshotDetails EMPTY = new SnapshotDetails(null, null, -1, -1); + public static SnapshotDetails EMPTY = new SnapshotDetails(null, null, -1, -1, null); @Nullable // TODO forbid nulls here, this only applies to very old repositories private final SnapshotState snapshotState; @@ -1050,11 +1058,23 @@ public static class SnapshotDetails { // May be -1 if unknown, which happens if the snapshot was taken before 7.14 and hasn't been updated yet private final long endTimeMillis; - public SnapshotDetails(@Nullable SnapshotState snapshotState, @Nullable Version version, long startTimeMillis, long endTimeMillis) { + // May be null if unknown, which happens if the snapshot was taken before 7.16 and hasn't been updated yet. Empty string indicates + // that this snapshot was not created by an SLM policy. + @Nullable + private final String slmPolicy; + + public SnapshotDetails( + @Nullable SnapshotState snapshotState, + @Nullable Version version, + long startTimeMillis, + long endTimeMillis, + @Nullable String slmPolicy + ) { this.snapshotState = snapshotState; this.version = version; this.startTimeMillis = startTimeMillis; this.endTimeMillis = endTimeMillis; + this.slmPolicy = slmPolicy; } @Nullable @@ -1081,6 +1101,15 @@ public long getEndTimeMillis() { return endTimeMillis; } + /** + * @return the SLM policy that the snapshot was created by or an empty string if it was not created by an SLM policy or + * {@code null} if unknown. + */ + @Nullable + public String getSlmPolicy() { + return slmPolicy; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -1089,12 +1118,13 @@ public boolean equals(Object o) { return startTimeMillis == that.startTimeMillis && endTimeMillis == that.endTimeMillis && snapshotState == that.snapshotState - && Objects.equals(version, that.version); + && Objects.equals(version, that.version) + && Objects.equals(slmPolicy, that.slmPolicy); } @Override public int hashCode() { - return Objects.hash(snapshotState, version, startTimeMillis, endTimeMillis); + return Objects.hash(snapshotState, version, startTimeMillis, endTimeMillis, slmPolicy); } } diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index b67ba7bb94028..3c266b19f521f 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -1411,11 +1411,13 @@ public void finalizeSnapshot(final FinalizeSnapshotContext finalizeSnapshotConte } final ActionListener allMetaListener = new GroupedActionListener<>(ActionListener.wrap(v -> { + final String slmPolicy = slmPolicy(snapshotInfo); final SnapshotDetails snapshotDetails = new SnapshotDetails( snapshotInfo.state(), Version.CURRENT, snapshotInfo.startTime(), - snapshotInfo.endTime() + snapshotInfo.endTime(), + slmPolicy ); writeIndexGen( existingRepositoryData.addSnapshot(snapshotId, snapshotDetails, shardGenerations, indexMetas, indexMetaIdentifiers), @@ -2264,40 +2266,36 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS .collect(Collectors.toList()); if (snapshotIdsWithMissingDetails.isEmpty() == false) { final Map extraDetailsMap = new ConcurrentHashMap<>(); - getSnapshotInfo( - new GetSnapshotInfoContext( - snapshotIdsWithMissingDetails, - false, - () -> false, - (context, snapshotInfo) -> extraDetailsMap.put( - snapshotInfo.snapshotId(), - new SnapshotDetails( - snapshotInfo.state(), - snapshotInfo.version(), - snapshotInfo.startTime(), - snapshotInfo.endTime() + getSnapshotInfo(new GetSnapshotInfoContext(snapshotIdsWithMissingDetails, false, () -> false, (context, snapshotInfo) -> { + final String slmPolicy = slmPolicy(snapshotInfo); + extraDetailsMap.put( + snapshotInfo.snapshotId(), + new SnapshotDetails( + snapshotInfo.state(), + snapshotInfo.version(), + snapshotInfo.startTime(), + snapshotInfo.endTime(), + slmPolicy + ) + ); + }, ActionListener.runAfter(new ActionListener() { + @Override + public void onResponse(Void aVoid) { + logger.info( + "Successfully loaded all snapshots' detailed information for {} from snapshot metadata", + AllocationService.firstListElementsToCommaDelimitedString( + snapshotIdsWithMissingDetails, + SnapshotId::toString, + logger.isDebugEnabled() ) - ), - ActionListener.runAfter(new ActionListener() { - @Override - public void onResponse(Void aVoid) { - logger.info( - "Successfully loaded all snapshots' detailed information for {} from snapshot metadata", - AllocationService.firstListElementsToCommaDelimitedString( - snapshotIdsWithMissingDetails, - SnapshotId::toString, - logger.isDebugEnabled() - ) - ); - } + ); + } - @Override - public void onFailure(Exception e) { - logger.warn("Failure when trying to load missing details from snapshot metadata", e); - } - }, () -> filterRepositoryDataStep.onResponse(repositoryData.withExtraDetails(extraDetailsMap))) - ) - ); + @Override + public void onFailure(Exception e) { + logger.warn("Failure when trying to load missing details from snapshot metadata", e); + } + }, () -> filterRepositoryDataStep.onResponse(repositoryData.withExtraDetails(extraDetailsMap))))); } else { filterRepositoryDataStep.onResponse(repositoryData); } @@ -2398,6 +2396,24 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS }, listener::onFailure); } + /** + * Extract slm policy from snapshot info. If none can be found, empty string is returned. + */ + private static String slmPolicy(SnapshotInfo snapshotInfo) { + final String slmPolicy; + if (snapshotInfo.userMetadata() == null) { + slmPolicy = ""; + } else { + final Object policyFound = snapshotInfo.userMetadata().get(SnapshotsService.POLICY_ID_METADATA_FIELD); + if (policyFound instanceof String) { + slmPolicy = (String) policyFound; + } else { + slmPolicy = ""; + } + } + return slmPolicy; + } + private RepositoryData updateRepositoryData(RepositoryData repositoryData, Version repositoryMetaversion, long newGen) { if (SnapshotsService.includesUUIDs(repositoryMetaversion)) { final String clusterUUID = clusterService.state().metadata().clusterUUID(); diff --git a/server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java b/server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java index 3e61ce38c9b09..9263623c576cb 100644 --- a/server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java @@ -111,7 +111,8 @@ public void testAddSnapshots() { randomFrom(SnapshotState.SUCCESS, SnapshotState.PARTIAL, SnapshotState.FAILED), randomFrom(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()), randomNonNegativeLong(), - randomNonNegativeLong() + randomNonNegativeLong(), + randomAlphaOfLength(10) ), shardGenerations, indexLookup, @@ -142,7 +143,8 @@ public void testInitIndices() { randomFrom(SnapshotState.values()), randomFrom(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()), randomNonNegativeLong(), - randomNonNegativeLong() + randomNonNegativeLong(), + randomAlphaOfLength(10) ) ); } @@ -209,7 +211,8 @@ public void testGetSnapshotState() { state, randomFrom(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()), randomNonNegativeLong(), - randomNonNegativeLong() + randomNonNegativeLong(), + randomAlphaOfLength(10) ), ShardGenerations.EMPTY, Collections.emptyMap(), @@ -241,7 +244,8 @@ public void testIndexThatReferencesAnUnknownSnapshot() throws IOException { parsedRepositoryData.getSnapshotState(snapshotId), parsedRepositoryData.getVersion(snapshotId), parsedRepositoryData.getSnapshotDetails(snapshotId).getStartTimeMillis(), - parsedRepositoryData.getSnapshotDetails(snapshotId).getEndTimeMillis() + parsedRepositoryData.getSnapshotDetails(snapshotId).getEndTimeMillis(), + randomAlphaOfLength(10) ) ); } @@ -389,7 +393,8 @@ public void testIndexMetaDataToRemoveAfterRemovingSnapshotWithSharing() { SnapshotState.SUCCESS, Version.CURRENT, randomNonNegativeLong(), - randomNonNegativeLong() + randomNonNegativeLong(), + randomAlphaOfLength(10) ); final RepositoryData newRepoData = repositoryData.addSnapshot(newSnapshot, details, shardGenerations, indexLookup, newIdentifiers); assertEquals( @@ -451,7 +456,8 @@ public static RepositoryData generateRandomRepoData() { randomFrom(SnapshotState.values()), randomFrom(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()), randomNonNegativeLong(), - randomNonNegativeLong() + randomNonNegativeLong(), + randomAlphaOfLength(10) ), builder.build(), indexLookup, diff --git a/server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java b/server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java index 7ad20c428d8f3..4cf4062fd48bc 100644 --- a/server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java +++ b/server/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java @@ -347,7 +347,10 @@ public void testRepositoryDataDetails() throws Exception { writeIndexGen( repository, repositoryData.withExtraDetails( - Collections.singletonMap(snapshotId, new RepositoryData.SnapshotDetails(SnapshotState.PARTIAL, Version.CURRENT, -1, -1)) + Collections.singletonMap( + snapshotId, + new RepositoryData.SnapshotDetails(SnapshotState.PARTIAL, Version.CURRENT, -1, -1, null) + ) ), repositoryData.getGenId() ); @@ -398,7 +401,8 @@ private RepositoryData addRandomSnapshotsToRepoData(RepositoryData repoData, boo randomFrom(SnapshotState.SUCCESS, SnapshotState.PARTIAL, SnapshotState.FAILED), Version.CURRENT, randomNonNegativeLong(), - randomNonNegativeLong() + randomNonNegativeLong(), + randomAlphaOfLength(10) ); repoData = repoData.addSnapshot( snapshotId, diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java index 218a319445162..1b0934c884f1b 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java @@ -276,7 +276,8 @@ public void getRepositoryData(ActionListener listener) { SnapshotState.SUCCESS, Version.CURRENT, nowMillis, - nowMillis)); + nowMillis, + "")); Index index = remoteIndices.get(indexName).getIndex(); indexSnapshots.put(new IndexId(indexName, index.getUUID()), Collections.singletonList(snapshotId)); }