Skip to content

Commit

Permalink
Add flush to buffer (apache#7609)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiacyu authored Dec 21, 2024
1 parent be18a49 commit 16322fd
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public class TestHSync {
public static void init() throws Exception {
final BucketLayout layout = BUCKET_LAYOUT;

CONF.setBoolean(OZONE_OM_RATIS_ENABLE_KEY, false);
CONF.setBoolean(OZONE_OM_RATIS_ENABLE_KEY, true);
CONF.set(OZONE_DEFAULT_BUCKET_LAYOUT, layout.name());
CONF.setBoolean(OzoneConfigKeys.OZONE_HBASE_ENHANCEMENTS_ALLOWED, true);
CONF.setBoolean("ozone.client.hbase.enhancements.allowed", true);
Expand Down Expand Up @@ -1426,9 +1426,12 @@ public void testHSyncKeyOverwriteNormalKey() throws Exception {
outputStream2.hsync();
outputStream2.close();
assertEquals(data1.length() + data2.length(), metrics.getDataCommittedBytes());
// wait until double buffer flush
cluster.getOzoneManager().awaitDoubleBufferFlush();

Map<String, OmKeyInfo> openKeys = getAllOpenKeys(openKeyTable);
Map<String, RepeatedOmKeyInfo> deletedKeys = getAllDeletedKeys(deletedTable);

// There should be no key in openKeyTable
assertEquals(0, openKeys.size());
// There should be one key in delete table
Expand Down Expand Up @@ -1503,6 +1506,8 @@ public void testHSyncKeyOverwriteHSyncKey() throws Exception {
// hsync/close second hsync key should success
outputStream2.hsync();
outputStream2.close();
// wait until double buffer flush
cluster.getOzoneManager().awaitDoubleBufferFlush();

Map<String, OmKeyInfo> openKeys = getAllOpenKeys(openKeyTable);
Map<String, RepeatedOmKeyInfo> deletedKeys = getAllDeletedKeys(deletedTable);
Expand Down

0 comments on commit 16322fd

Please sign in to comment.