Skip to content

Commit a80d07b

Browse files
committed
doc about non-blocking refreshes and reset
1 parent a6cad19 commit a80d07b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

server/src/main/java/org/elasticsearch/index/engine/Engine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ public void externalRefresh(String source, ActionListener<Engine.RefreshResult>
12891289

12901290
/**
12911291
* Asynchronously refreshes the engine for new search operations to reflect the latest
1292-
* changes unless another thread is already refreshing the engine concurrently.
1292+
* changes unless another thread is already refreshing or reseting the engine concurrently.
12931293
*/
12941294
@Nullable
12951295
public abstract void maybeRefresh(String source, ActionListener<RefreshResult> listener) throws EngineException;

server/src/main/java/org/elasticsearch/index/shard/IndexShard.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4433,6 +4433,8 @@ public void afterRefresh(boolean didRefresh) {
44334433
*
44344434
* In general, resetting the engine should be done with care, to consider any in-progress operations and listeners.
44354435
* At the moment, this is implemented in serverless for a special case that ensures the engine is prepared for reset.
4436+
* Reseting the engine can prevent non-blocking engine refreshes (see {@link Engine#maybeRefresh(String, ActionListener)} to be
4437+
* immediately executed, so it is expected that the new engine instance provides refreshed readers (if supported) after the reset.
44364438
*
44374439
* @param postResetNewEngineConsumer A consumer that will be called with the newly created engine after the reset
44384440
* is complete, allowing for post-reset operations on the new engine instance.

0 commit comments

Comments
 (0)