Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track Shard-Snapshot Index Generation at Repository Root #46250

Merged
Show file tree
Hide file tree
Changes from 179 commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
e978473
bck
original-brownbear Sep 2, 2019
7afa152
sorta works
original-brownbear Sep 2, 2019
14ab8ca
better
original-brownbear Sep 2, 2019
1c9fc7f
pass
original-brownbear Sep 3, 2019
32e514f
bck
original-brownbear Sep 3, 2019
21253d8
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 3, 2019
8e896de
moar asserts
original-brownbear Sep 3, 2019
3b9a791
fix CCR repo
original-brownbear Sep 3, 2019
ac223a7
fix tests
original-brownbear Sep 3, 2019
9e87c46
fix some inconsistencies
original-brownbear Sep 3, 2019
b7e9aab
remove risky delete
original-brownbear Sep 3, 2019
9149f74
nicer
original-brownbear Sep 3, 2019
7305618
extract fallback logic
original-brownbear Sep 3, 2019
95f179a
comment
original-brownbear Sep 3, 2019
ac3180f
ensure not leaking shard index-N
original-brownbear Sep 3, 2019
a11ef41
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 3, 2019
deba084
some bwc
original-brownbear Sep 3, 2019
4e8316b
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 3, 2019
cd9fe7a
half fix bwc
original-brownbear Sep 3, 2019
0d86637
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 3, 2019
93e3f62
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 4, 2019
51e5b1a
assertion and nicer order
original-brownbear Sep 4, 2019
addcf45
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 4, 2019
8e110c9
add version param
original-brownbear Sep 4, 2019
eb51be5
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 5, 2019
79dd09a
implement BwC
original-brownbear Sep 5, 2019
3a7508e
bulk delete old index-N
original-brownbear Sep 5, 2019
a2b1a5b
fix update on empty shard list
original-brownbear Sep 5, 2019
41841e7
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 5, 2019
91f0931
bck
original-brownbear Sep 5, 2019
50fd078
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 5, 2019
77bf0a5
horrible but safe
original-brownbear Sep 5, 2019
3fe616c
drier
original-brownbear Sep 6, 2019
46c0b6e
closer
original-brownbear Sep 6, 2019
fe9cfa6
stop redundant reading of metadata
original-brownbear Sep 6, 2019
6ccc080
nicer
original-brownbear Sep 6, 2019
3788ca3
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 6, 2019
2fe0182
even safer ...
original-brownbear Sep 6, 2019
7bcd5da
much faster
original-brownbear Sep 6, 2019
a552661
safer
original-brownbear Sep 6, 2019
8145406
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 6, 2019
7513ce5
some doc improvements
original-brownbear Sep 6, 2019
5517724
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 7, 2019
3ed96ec
start extracting index gen math
original-brownbear Sep 7, 2019
8bfe736
nicer
original-brownbear Sep 8, 2019
b89040c
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 8, 2019
363e6d7
simpler
original-brownbear Sep 8, 2019
74869b6
smarter bwc
original-brownbear Sep 8, 2019
490b1ef
nicer
original-brownbear Sep 8, 2019
f123b9b
more sanity
original-brownbear Sep 8, 2019
87727ea
fix more possible inconsistencies
original-brownbear Sep 9, 2019
af14c18
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 9, 2019
bc10987
fix tests
original-brownbear Sep 9, 2019
c93b654
way moar docs
original-brownbear Sep 9, 2019
ee621f9
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 9, 2019
35ec43a
docs, better equals etc.
original-brownbear Sep 9, 2019
ce5374e
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 9, 2019
3ce0b62
update docs and add test todo
original-brownbear Sep 9, 2019
a60fce7
clarify
original-brownbear Sep 9, 2019
5d82911
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 9, 2019
f94e2ff
drier and nicer
original-brownbear Sep 9, 2019
c0bce85
shorter
original-brownbear Sep 9, 2019
8e8ad71
shorter
original-brownbear Sep 9, 2019
8382340
slightly nicer
original-brownbear Sep 9, 2019
47fab04
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 10, 2019
b6fc8c0
nicer
original-brownbear Sep 10, 2019
3880103
nicer apis more docs
original-brownbear Sep 10, 2019
03b287e
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 10, 2019
c0ebec2
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 10, 2019
d64853b
comment
original-brownbear Sep 10, 2019
c75fe5d
nicer comment
original-brownbear Sep 10, 2019
7271184
nicer
original-brownbear Sep 10, 2019
7e1288d
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 10, 2019
15c7e7a
shorter diff
original-brownbear Sep 10, 2019
2eb29ee
smaller diff
original-brownbear Sep 10, 2019
8d535ee
smaller diff
original-brownbear Sep 10, 2019
e1a7492
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 11, 2019
6252c4e
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 12, 2019
f7c0949
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 14, 2019
b3adb0b
nicer and fix stuff
original-brownbear Sep 14, 2019
1ceca5b
smaller diff
original-brownbear Sep 15, 2019
23444c1
smaller diff
original-brownbear Sep 15, 2019
214f12c
nicer diff
original-brownbear Sep 15, 2019
f831f2a
smaller diff
original-brownbear Sep 15, 2019
b5629b2
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 17, 2019
d8d0538
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 17, 2019
cc4ce1b
yet smaller diff
original-brownbear Sep 17, 2019
2f1c565
save line
original-brownbear Sep 17, 2019
0153cd3
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 18, 2019
88221b1
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 18, 2019
a4a3fd5
smaller diff
original-brownbear Sep 18, 2019
54b4fe5
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 18, 2019
2f18238
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 18, 2019
b3bfb82
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 19, 2019
929bc1a
fix typo
original-brownbear Sep 19, 2019
9b5d902
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 23, 2019
72ed551
fix
original-brownbear Sep 23, 2019
3ffd0d0
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 23, 2019
8fd05c6
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 25, 2019
24fc5ec
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Sep 25, 2019
0d95a83
shorter
original-brownbear Sep 25, 2019
c23e5c8
shorter
original-brownbear Sep 25, 2019
d6fcd19
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 1, 2019
dd81d6c
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 1, 2019
55ba2c7
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 1, 2019
e2f2d5b
align new and old path
original-brownbear Oct 1, 2019
8042c38
drier
original-brownbear Oct 1, 2019
aa85262
shorter
original-brownbear Oct 1, 2019
3a0263e
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 1, 2019
5c226d4
shorter
original-brownbear Oct 1, 2019
0f8323d
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 1, 2019
56505b9
shorter
original-brownbear Oct 1, 2019
76b7218
simpler
original-brownbear Oct 2, 2019
6bcfbbe
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 2, 2019
95d6982
simpller
original-brownbear Oct 2, 2019
2b06826
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 2, 2019
5e62251
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 3, 2019
1ed9f22
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 3, 2019
1ac6807
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 3, 2019
381f429
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 3, 2019
cbca20a
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 4, 2019
27028d5
shorter diff
original-brownbear Oct 4, 2019
c574d86
shorter
original-brownbear Oct 4, 2019
c4599fc
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 5, 2019
77c6918
more solid assertion
original-brownbear Oct 5, 2019
f8cb751
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 7, 2019
855b4fc
much shorter
original-brownbear Oct 7, 2019
18e0611
shorter
original-brownbear Oct 7, 2019
0bcdc95
shorter diff
original-brownbear Oct 7, 2019
c36ffb3
simpler
original-brownbear Oct 7, 2019
a87bc8c
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 8, 2019
8bfd187
nicer
original-brownbear Oct 8, 2019
dff329b
fix formatting
original-brownbear Oct 8, 2019
108304e
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 8, 2019
85cd324
fix BwC
original-brownbear Oct 8, 2019
69a1c92
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 8, 2019
9eb2f92
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 8, 2019
17ad546
CR comments
original-brownbear Oct 8, 2019
d084698
Rename + assert
original-brownbear Oct 8, 2019
0a82497
make it a fragment
original-brownbear Oct 8, 2019
4bed2e5
renamings
original-brownbear Oct 8, 2019
0f4b316
fix and test handling same index name for different indices
original-brownbear Oct 9, 2019
454c7d9
fix logging
original-brownbear Oct 9, 2019
52765d7
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 9, 2019
ac36fbd
flatten delete method into one
original-brownbear Oct 9, 2019
e6e74c7
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 9, 2019
673992c
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 9, 2019
98f0faf
some Cr comments
original-brownbear Oct 9, 2019
7606d02
adjust serialization
original-brownbear Oct 9, 2019
1d52fec
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 10, 2019
92860e8
Some CR comments addressed
original-brownbear Oct 10, 2019
74a2f2b
Some CR comments addressed
original-brownbear Oct 10, 2019
4a869d4
add comment
original-brownbear Oct 10, 2019
90c1df2
refactor for easier readability
original-brownbear Oct 10, 2019
b9dbd7c
Add new shard placeholder
original-brownbear Oct 10, 2019
f32bacd
still need that bwc
original-brownbear Oct 10, 2019
ec5ce04
Merge branch 'master' of https://github.com/elastic/elasticsearch int…
original-brownbear Oct 10, 2019
d827ceb
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 11, 2019
1109c26
revert needless change
original-brownbear Oct 11, 2019
3a66c79
track snapshot format in SNapshotsInProgress.Entry
original-brownbear Oct 11, 2019
b069c06
fix indent
original-brownbear Oct 11, 2019
debfa05
remove dead code
original-brownbear Oct 11, 2019
248c17b
fix indent
original-brownbear Oct 11, 2019
3162c5d
unmodifiable map
original-brownbear Oct 11, 2019
9a15067
nit empty map
original-brownbear Oct 11, 2019
eca8365
be less stupid when deleting
original-brownbear Oct 11, 2019
1dffe60
CR: correctly deal with lowering shard count on constant index name
original-brownbear Oct 11, 2019
08fbba4
address nits
original-brownbear Oct 11, 2019
dedc261
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 11, 2019
f8a6eb6
add generation to logging
original-brownbear Oct 11, 2019
3f79cd2
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 17, 2019
8ca5516
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 17, 2019
9e83cd0
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 18, 2019
eaadf31
add comment
original-brownbear Oct 18, 2019
ac34a1e
flag not version
original-brownbear Oct 18, 2019
77eeb7d
flatter ordered blobstore delete
original-brownbear Oct 18, 2019
5295322
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 21, 2019
1bdbf2c
CR: Yannicks patch
original-brownbear Oct 21, 2019
68e407c
slight change
original-brownbear Oct 21, 2019
76fa53f
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 22, 2019
a3c6f3d
CR: fix listener fallthrough
original-brownbear Oct 22, 2019
222c587
Merge remote-tracking branch 'elastic/master' into smarter-incrementa…
original-brownbear Oct 22, 2019
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 @@ -42,6 +42,7 @@
import org.elasticsearch.repositories.Repository;
import org.elasticsearch.repositories.RepositoryCleanupResult;
import org.elasticsearch.repositories.blobstore.BlobStoreRepository;
import org.elasticsearch.snapshots.SnapshotsService;
import org.elasticsearch.tasks.Task;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
Expand Down Expand Up @@ -201,7 +202,9 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
logger.debug("Initialized repository cleanup in cluster state for [{}][{}]", repositoryName, repositoryStateId);
threadPool.executor(ThreadPool.Names.SNAPSHOT).execute(ActionRunnable.wrap(listener,
l -> blobStoreRepository.cleanup(
repositoryStateId, ActionListener.wrap(result -> after(null, result), e -> after(e, null)))));
repositoryStateId,
newState.nodes().getMinNodeVersion().onOrAfter(SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION),
ActionListener.wrap(result -> after(null, result), e -> after(e, null)))));
}

private void after(@Nullable Exception failure, @Nullable RepositoryCleanupResult result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ public static class Entry implements ToXContent {
private final ImmutableOpenMap<String, List<ShardId>> waitingIndices;
private final long startTime;
private final long repositoryStateId;
// see #useShardGenerations
private final boolean useShardGenerations;
@Nullable private final Map<String, Object> userMetadata;
@Nullable private final String failure;

public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices,
long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards,
String failure, Map<String, Object> userMetadata) {
String failure, Map<String, Object> userMetadata, boolean useShardGenerations) {
this.state = state;
this.snapshot = snapshot;
this.includeGlobalState = includeGlobalState;
Expand All @@ -114,6 +116,7 @@ public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, Sta
this.repositoryStateId = repositoryStateId;
this.failure = failure;
this.userMetadata = userMetadata;
this.useShardGenerations = useShardGenerations;
}

private static boolean assertShardsConsistent(State state, List<IndexId> indices,
Expand All @@ -128,20 +131,22 @@ private static boolean assertShardsConsistent(State state, List<IndexId> indices
: "Indices in shards " + indexNamesInShards + " differ from expected indices " + indexNames + " for state [" + state + "]";
return true;
}

public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices,
long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards,
Map<String, Object> userMetadata) {
this(snapshot, includeGlobalState, partial, state, indices, startTime, repositoryStateId, shards, null, userMetadata);
Map<String, Object> userMetadata, boolean useShardGenerations) {
this(snapshot, includeGlobalState, partial, state, indices, startTime, repositoryStateId, shards, null, userMetadata,
useShardGenerations);
}

public Entry(Entry entry, State state, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards) {
this(entry.snapshot, entry.includeGlobalState, entry.partial, state, entry.indices, entry.startTime,
entry.repositoryStateId, shards, entry.failure, entry.userMetadata);
entry.repositoryStateId, shards, entry.failure, entry.userMetadata, entry.useShardGenerations);
}

public Entry(Entry entry, State state, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards, String failure) {
this(entry.snapshot, entry.includeGlobalState, entry.partial, state, entry.indices, entry.startTime,
entry.repositoryStateId, shards, failure, entry.userMetadata);
entry.repositoryStateId, shards, failure, entry.userMetadata, entry.useShardGenerations);
}

public Entry(Entry entry, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards) {
Expand Down Expand Up @@ -192,6 +197,16 @@ public String failure() {
return failure;
}

/**
* Whether to write to the repository in a format only understood by versions newer than
* {@link SnapshotsService#SHARD_GEN_IN_REPO_DATA_VERSION}.
*
* @return true if writing to repository in new format
*/
public boolean useShardGenerations() {
return useShardGenerations;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -207,6 +222,7 @@ public boolean equals(Object o) {
if (!snapshot.equals(entry.snapshot)) return false;
if (state != entry.state) return false;
if (repositoryStateId != entry.repositoryStateId) return false;
if (useShardGenerations != entry.useShardGenerations) return false;

return true;
}
Expand All @@ -221,6 +237,7 @@ public int hashCode() {
result = 31 * result + indices.hashCode();
result = 31 * result + Long.hashCode(startTime);
result = 31 * result + Long.hashCode(repositoryStateId);
result = 31 * result + (useShardGenerations ? 1 : 0);
return result;
}

Expand Down Expand Up @@ -503,6 +520,12 @@ public SnapshotsInProgress(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(METADATA_FIELD_INTRODUCED)) {
userMetadata = in.readMap();
}
final boolean useShardGenerations;
if (in.getVersion().onOrAfter(SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION)) {
useShardGenerations = in.readBoolean();
} else {
useShardGenerations = false;
}
entries[i] = new Entry(snapshot,
includeGlobalState,
partial,
Expand All @@ -512,7 +535,8 @@ public SnapshotsInProgress(StreamInput in) throws IOException {
repositoryStateId,
builder.build(),
failure,
userMetadata
userMetadata,
useShardGenerations
);
}
this.entries = Arrays.asList(entries);
Expand Down Expand Up @@ -541,6 +565,9 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(METADATA_FIELD_INTRODUCED)) {
out.writeMap(entry.userMetadata);
}
if (out.getVersion().onOrAfter(SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION)) {
out.writeBoolean(entry.useShardGenerations);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,17 @@ public RepositoryData getRepositoryData() {
}

@Override
public void finalizeSnapshot(SnapshotId snapshotId, List<IndexId> indices, long startTime, String failure, int totalShards,
List<SnapshotShardFailure> shardFailures, long repositoryStateId, boolean includeGlobalState,
MetaData metaData, Map<String, Object> userMetadata, ActionListener<SnapshotInfo> listener) {
in.finalizeSnapshot(snapshotId, indices, startTime, failure, totalShards, shardFailures, repositoryStateId,
includeGlobalState, metaData, userMetadata, listener);
public void finalizeSnapshot(SnapshotId snapshotId, ShardGenerations shardGenerations, long startTime, String failure,
int totalShards, List<SnapshotShardFailure> shardFailures, long repositoryStateId,
boolean includeGlobalState, MetaData metaData, Map<String, Object> userMetadata,
boolean writeShardGens, ActionListener<SnapshotInfo> listener) {
in.finalizeSnapshot(snapshotId, shardGenerations, startTime, failure, totalShards, shardFailures, repositoryStateId,
includeGlobalState, metaData, userMetadata, writeShardGens, listener);
}

@Override
public void deleteSnapshot(SnapshotId snapshotId, long repositoryStateId, ActionListener<Void> listener) {
in.deleteSnapshot(snapshotId, repositoryStateId, listener);
public void deleteSnapshot(SnapshotId snapshotId, long repositoryStateId, boolean writeShardGens, ActionListener<Void> listener) {
in.deleteSnapshot(snapshotId, repositoryStateId, writeShardGens, listener);
}

@Override
Expand Down Expand Up @@ -117,8 +118,9 @@ public boolean isReadOnly() {

@Override
public void snapshotShard(Store store, MapperService mapperService, SnapshotId snapshotId, IndexId indexId,
IndexCommit snapshotIndexCommit, IndexShardSnapshotStatus snapshotStatus, ActionListener<String> listener) {
in.snapshotShard(store, mapperService, snapshotId, indexId, snapshotIndexCommit, snapshotStatus, listener);
IndexCommit snapshotIndexCommit, IndexShardSnapshotStatus snapshotStatus, boolean writeShardGens,
ActionListener<String> listener) {
in.snapshotShard(store, mapperService, snapshotId, indexId, snapshotIndexCommit, snapshotStatus, writeShardGens, listener);
}
@Override
public void restoreShard(Store store, SnapshotId snapshotId, IndexId indexId, ShardId snapshotShardId, RecoveryState recoveryState) {
Expand Down
33 changes: 19 additions & 14 deletions server/src/main/java/org/elasticsearch/repositories/Repository.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,28 +112,33 @@ default Repository create(RepositoryMetaData metaData, Function<String, Reposito
* <p>
* This method is called on master after all shards are snapshotted.
*
* @param snapshotId snapshot id
* @param indices list of indices in the snapshot
* @param startTime start time of the snapshot
* @param failure global failure reason or null
* @param totalShards total number of shards
* @param shardFailures list of shard failures
* @param repositoryStateId the unique id identifying the state of the repository when the snapshot began
* @param snapshotId snapshot id
* @param shardGenerations updated shard generations
* @param startTime start time of the snapshot
* @param failure global failure reason or null
* @param totalShards total number of shards
* @param shardFailures list of shard failures
* @param repositoryStateId the unique id identifying the state of the repository when the snapshot began
* @param includeGlobalState include cluster global state
* @param clusterMetaData cluster metadata
* @param userMetadata user metadata
* @param writeShardGens if shard generations should be written to the repository
* @param listener listener to be called on completion of the snapshot
*/
void finalizeSnapshot(SnapshotId snapshotId, List<IndexId> indices, long startTime, String failure, int totalShards,
List<SnapshotShardFailure> shardFailures, long repositoryStateId, boolean includeGlobalState,
MetaData clusterMetaData, Map<String, Object> userMetadata, ActionListener<SnapshotInfo> listener);
void finalizeSnapshot(SnapshotId snapshotId, ShardGenerations shardGenerations, long startTime, String failure,
int totalShards, List<SnapshotShardFailure> shardFailures, long repositoryStateId,
boolean includeGlobalState, MetaData clusterMetaData, Map<String, Object> userMetadata,
boolean writeShardGens, ActionListener<SnapshotInfo> listener);

/**
* Deletes snapshot
*
* @param snapshotId snapshot id
* @param snapshotId snapshot id
* @param repositoryStateId the unique id identifying the state of the repository when the snapshot deletion began
* @param listener completion listener
* @param writeShardGens if shard generations should be written to the repository
* @param listener completion listener
*/
void deleteSnapshot(SnapshotId snapshotId, long repositoryStateId, ActionListener<Void> listener);
void deleteSnapshot(SnapshotId snapshotId, long repositoryStateId, boolean writeShardGens, ActionListener<Void> listener);

/**
* Returns snapshot throttle time in nanoseconds
Expand Down Expand Up @@ -195,7 +200,7 @@ void finalizeSnapshot(SnapshotId snapshotId, List<IndexId> indices, long startTi
* @param listener listener invoked on completion
*/
void snapshotShard(Store store, MapperService mapperService, SnapshotId snapshotId, IndexId indexId, IndexCommit snapshotIndexCommit,
IndexShardSnapshotStatus snapshotStatus, ActionListener<String> listener);
IndexShardSnapshotStatus snapshotStatus, boolean writeShardGens, ActionListener<String> listener);

/**
* Restores snapshot of the shard.
Expand Down
Loading