You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defer repo ops in searchable snapshot restore (#54211)
A searchable snapshots `Directory` requires a `BlobContainer` and a
`BlobStoreIndexShardSnapshot`, which require us to read some data from the
repository. Today we construct these objects on the cluster applier thread,
blocking that thread on remote operations.
This commit defers their construction until the restore process starts, so that
they can happen on a more appropriate thread. It also reinstates the assertion
that constructing the blob container only occurs on the snapshot or generic
threadpool, and adds an assertion that blobs are only accessed on snapshot or
generic or search threads too.
Co-authored-by: Tanguy Leroux <[email protected]>
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/BaseSearchableSnapshotIndexInput.java
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/SearchableSnapshotDirectory.java
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/direct/DirectBlobContainerIndexInput.java
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/SearchableSnapshotDirectoryTests.java
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/cache/CachedBlobContainerIndexInputStatsTests.java
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/cache/CachedBlobContainerIndexInputTests.java
+10-7
Original file line number
Diff line number
Diff line change
@@ -55,15 +55,18 @@ public void testRandomReads() throws IOException {
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/xpack/searchablesnapshots/AbstractSearchableSnapshotsRestTestCase.java
+12-2
Original file line number
Diff line number
Diff line change
@@ -191,8 +191,7 @@ public void testClearCache() throws Exception {
0 commit comments