This is an automated email from the ASF dual-hosted git repository.
wchevreuil pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.6 by this push:
new 119aaa88562 HBASE-30166 ADDENDUM TestPrefetchPersistence may still
fail due to prefetch delay (#8333)
119aaa88562 is described below
commit 119aaa8856229f09dd71bcc41217e417b56a2545
Author: Wellington Ramos Chevreuil <[email protected]>
AuthorDate: Thu Jun 11 19:35:54 2026 +0100
HBASE-30166 ADDENDUM TestPrefetchPersistence may still fail due to prefetch
delay (#8333)
Co-authored-by: Claude Code Opus 4.6 <[email protected]>
Signed-off-by: Dávid Paksy <[email protected]>
Signed-off-by: Peng Lu <[email protected]>
---
.../hbase/io/hfile/bucket/TestPrefetchPersistence.java | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git
a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestPrefetchPersistence.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestPrefetchPersistence.java
index d8ec6796bba..32095ad578e 100644
---
a/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestPrefetchPersistence.java
+++
b/hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestPrefetchPersistence.java
@@ -32,11 +32,13 @@ import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseParameterizedTestTemplate;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.Waiter;
import org.apache.hadoop.hbase.fs.HFileSystem;
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
import org.apache.hadoop.hbase.io.hfile.HFile;
import org.apache.hadoop.hbase.io.hfile.HFileContext;
import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
+import org.apache.hadoop.hbase.io.hfile.PrefetchExecutor;
import org.apache.hadoop.hbase.io.hfile.RandomKeyValueUtil;
import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
import org.apache.hadoop.hbase.testclassification.IOTests;
@@ -94,6 +96,8 @@ public class TestPrefetchPersistence {
public void setup() throws IOException {
conf = TEST_UTIL.getConfiguration();
conf.setBoolean(CacheConfig.PREFETCH_BLOCKS_ON_OPEN_KEY, true);
+ conf.setInt(PrefetchExecutor.PREFETCH_DELAY, 0);
+ PrefetchExecutor.loadConfiguration(conf);
testDir = TEST_UTIL.getDataTestDir();
TEST_UTIL.getTestFileSystem().mkdirs(testDir);
fs = HFileSystem.get(conf);
@@ -138,14 +142,8 @@ public class TestPrefetchPersistence {
public void readStoreFile(Path storeFilePath) throws Exception {
// Open the file
HFile.Reader reader = HFile.createReader(fs, storeFilePath, cacheConf,
true, conf);
- int retries = 0;
- while (
- !reader.prefetchComplete()
- && !bucketCache.fullyCachedFiles.containsKey(storeFilePath.getName())
&& retries < 5
- ) {
- Thread.sleep(500);
- retries++;
- }
+ Waiter.waitFor(conf, 30000, () -> reader.prefetchComplete()
+ || bucketCache.fullyCachedFiles.containsKey(storeFilePath.getName()));
}
public Path writeStoreFile(String fname) throws IOException {