[ASTERIXDB-3458][STO] Halt on page write failure
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
On write failures, if an exception is thrown,
index bulk-loaders continue to write until
the bulk loader ends. Afterwards, the system
will halt. Instead, the bulkload operation
should halt immediately.
Ext-ref: MB-62715
Change-Id: I79a88922585123fb97239ee6c8be5984d2ab2c08
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18486
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/FIFOLocalWriter.java b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/FIFOLocalWriter.java
index e076686..7d4e119 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/FIFOLocalWriter.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/buffercache/FIFOLocalWriter.java
@@ -46,13 +46,10 @@
callback.beforeWrite(cPage);
bufferCache.write(cPage, context);
callback.afterWrite(cPage);
- } catch (Exception e) {
- handleWriteFailure(page, e);
- LOGGER.warn("Failed to write page {}", cPage, e);
} catch (Throwable th) {
// Halt
- LOGGER.error("FIFOLocalWriter has encountered a fatal error", th);
- ExitUtil.halt(ExitUtil.EC_ABNORMAL_TERMINATION);
+ LOGGER.error("Failed to write page {}", cPage, th);
+ ExitUtil.halt(ExitUtil.EC_IO_OPERATION_FAILED);
} finally {
bufferCache.returnPage(cPage);
if (DEBUG) {
@@ -61,12 +58,4 @@
}
}
- private void handleWriteFailure(ICachedPage page, Exception e) {
- if (failureCallback != null) {
- failureCallback.writeFailed(page, e);
- } else {
- LOGGER.error("an IO failure took place but the failure callback is not set", e);
- }
- }
-
}