[ASTERIXDB-2738][STO] Create Mask File Before Merge Operations
authorMurtadha Hubail <mhubail@apache.org>
Thu, 21 May 2020 18:29:46 +0000 (21:29 +0300)
committerMurtadha Hubail <mhubail@apache.org>
Wed, 10 Feb 2021 19:16:42 +0000 (19:16 +0000)
commitaa0f9a9338e7ded2b2c519e6dd9d24c7c078bb0c
tree571fe5583a547981c47a94725496c513337c05ef
parentdc12fc01407314eefe40e2296fb840d9d2d2d8d7
[ASTERIXDB-2738][STO] Create Mask File Before Merge Operations

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Before starting a merge operation, create a mask file
  (.mask_C_startSeq_endSeq) for the merged component to
  indicate that this component isn't valid yet.
- On the merge operation successful completion, delete the
  merged component mask file.
- In the case of any unexpected failure during the merge
  operation, all files of the failed merged component will
  be deleted on node startup/shutdown, including the mask
  file.
- Halt on any IO opeartion failure.
- Add a test case that ensures only masked merged components
  are deleted but not the original components that were
  supposed to be merged.

(cherry picked from commit fe0f6fa181b03195cda8ff3585734ce10f466467)

Change-Id: I7c07daf033c5a1a00bd1b33debc8a4d7c7ce1e59
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/9964
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Reviewed-by: Michael Blow <mblow@apache.org>
asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/HaltCallback.java
asterixdb/asterix-app/src/test/java/org/apache/asterix/test/storage/PersistentLocalResourceRepositoryTest.java
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/ioopcallbacks/LSMIOOperationCallback.java
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/storage/ResourceReference.java
asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/messaging/ComponentMaskTask.java
asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/resource/PersistentLocalResourceRepository.java
hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java