[ASTERIXDB-1706][RT] Ensure Result Files Are Flushed

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

Details:
- Ensure result files are flushed to disk.

Change-Id: I32e77187ed8cb9d7fd17ab83a9e8fb9264f11851
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2319
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/dataset/ResultState.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/dataset/ResultState.java
index 3e3f06b..afce266 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/dataset/ResultState.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/dataset/ResultState.java
@@ -127,7 +127,7 @@
             String fName = FILE_PREFIX + String.valueOf(resultSetPartitionId.getPartition());
             fileRef = fileFactory.createUnmanagedWorkspaceFile(fName);
             writeFileHandle = ioManager.open(fileRef, IIOManager.FileReadWriteMode.READ_WRITE,
-                    IIOManager.FileSyncMode.METADATA_ASYNC_DATA_ASYNC);
+                    IIOManager.FileSyncMode.METADATA_ASYNC_DATA_SYNC);
         }
 
         size += ioManager.syncWrite(writeFileHandle, size, buffer);