Flush before closing column family handles
This commit is contained in:
parent
02eea5ac66
commit
97cf151afb
@ -149,13 +149,6 @@ public sealed interface TransactionalDB extends Closeable {
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
exceptions.add(ex);
|
exceptions.add(ex);
|
||||||
}
|
}
|
||||||
for (ColumnFamilyHandle handle : handles) {
|
|
||||||
try {
|
|
||||||
handle.close();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
exceptions.add(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
if (db.isOwningHandle()) {
|
if (db.isOwningHandle()) {
|
||||||
db.flushWal(true);
|
db.flushWal(true);
|
||||||
@ -165,11 +158,18 @@ public sealed interface TransactionalDB extends Closeable {
|
|||||||
}
|
}
|
||||||
try (var options = new FlushOptions().setWaitForFlush(true).setAllowWriteStall(true)) {
|
try (var options = new FlushOptions().setWaitForFlush(true).setAllowWriteStall(true)) {
|
||||||
if (db.isOwningHandle()) {
|
if (db.isOwningHandle()) {
|
||||||
db.flush(options);
|
db.flush(options, handles);
|
||||||
}
|
}
|
||||||
} catch (RocksDBException e) {
|
} catch (RocksDBException e) {
|
||||||
exceptions.add(e);
|
exceptions.add(e);
|
||||||
}
|
}
|
||||||
|
for (ColumnFamilyHandle handle : handles) {
|
||||||
|
try {
|
||||||
|
handle.close();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
exceptions.add(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (db.isOwningHandle()) {
|
if (db.isOwningHandle()) {
|
||||||
db.closeE();
|
db.closeE();
|
||||||
|
Loading…
Reference in New Issue
Block a user