mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
don't delete shards state in the state handle, but let the indices store eventually delete it based on its logic of when to delete a shard
This commit is contained in:
parent
6cd9b92f95
commit
3ab85bacdd
@ -157,15 +157,17 @@ public class LocalGatewayShardsState extends AbstractComponent implements Cluste
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// REMOVED: don't delete shard state, rely on IndicesStore to delete the shard location
|
||||||
|
// only once all shards are allocated on another node
|
||||||
// now, go over the current ones and delete ones that are not in the new one
|
// now, go over the current ones and delete ones that are not in the new one
|
||||||
for (Map.Entry<ShardId, ShardStateInfo> entry : currentState.entrySet()) {
|
// for (Map.Entry<ShardId, ShardStateInfo> entry : currentState.entrySet()) {
|
||||||
ShardId shardId = entry.getKey();
|
// ShardId shardId = entry.getKey();
|
||||||
if (!newState.containsKey(shardId)) {
|
// if (!newState.containsKey(shardId)) {
|
||||||
if (!metaState.isDangling(shardId.index().name())) {
|
// if (!metaState.isDangling(shardId.index().name())) {
|
||||||
deleteShardState(shardId);
|
// deleteShardState(shardId);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.currentState = newState;
|
this.currentState = newState;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user