Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11870. Fix TestHSync overwrite cases for OM Ratis enabled #7609

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading