You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/03/12 16:22:11 UTC
[GitHub] [hbase] joshelser commented on a change in pull request #4202: HBASE-26791 Memstore flush fencing issue for SFT
joshelser commented on a change in pull request #4202:
URL: https://github.com/apache/hbase/pull/4202#discussion_r825317778
##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/storefiletracker/TestStoreFileListFile.java
##########
@@ -160,6 +167,33 @@ public void testChecksumMismatch() throws IOException {
byte[] content = readAll(fs, trackerFileStatus.getPath());
content[5] = (byte) ~content[5];
write(fs, trackerFileStatus.getPath(), content, 0, content.length);
- assertThrows(IOException.class, () -> storeFileListFile.load());
+ assertThrows(IOException.class, () -> storeFileListFile.load(false));
+ }
+
+ @Test
+ public void testLoadNewerTrackFiles() throws IOException, InterruptedException {
+ StoreFileList.Builder builder = StoreFileList.newBuilder();
+ storeFileListFile.update(builder);
+
+ FileSystem fs = FileSystem.get(UTIL.getConfiguration());
+ FileStatus trackFileStatus = getOnlyTrackerFile(fs);
+
+ builder.addStoreFile(StoreFileEntry.newBuilder().setName("hehe").setSize(10).build());
+ storeFileListFile = create();
+ storeFileListFile.update(builder);
+
+ // should load the list we stored the second time
+ storeFileListFile = create();
+ StoreFileList list = storeFileListFile.load(true);
+ assertEquals(1, list.getStoreFileCount());
+ // since read only is true, we should not delete the old track file
+ // the deletion is in background, so sleep a bit then assert
+ Thread.sleep(2000);
+ assertTrue(fs.exists(trackFileStatus.getPath()));
Review comment:
Use the `HTU.Waiter` to check a few times please.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org