Skip to content

Commit

Permalink
0002449: File sync sometimes not deleting files with delete_after_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Nov 19, 2015
1 parent 80dcb8b commit 68646c2
Showing 1 changed file with 6 additions and 7 deletions.
Expand Up @@ -495,16 +495,14 @@ public List<OutgoingBatch> sendFiles(ProcessInfo processInfo, Node targetNode,

public void acknowledgeFiles(OutgoingBatch outgoingBatch) {
log.debug("Acknowledging file_sync outgoing batch-{}", outgoingBatch.getBatchId());
ISqlReadCursor<Data> cursor = engine.getDataService().selectDataFor(
outgoingBatch.getBatchId(), outgoingBatch.getChannelId());
Data data = null;
List<File> filesToDelete = new ArrayList<File>();
Table snapshotTable = platform.getTableFromCache(
TableConstants.getTableName(tablePrefix, TableConstants.SYM_FILE_SNAPSHOT), false);
for (int i = 0; i < outgoingBatch.getInsertEventCount(); i++) {
data = cursor.next();
if (data != null
&& (data.getDataEventType() == DataEventType.INSERT || data.getDataEventType() == DataEventType.UPDATE)) {
ISqlReadCursor<Data> cursor = engine.getDataService().selectDataFor(
outgoingBatch.getBatchId(), outgoingBatch.getChannelId());
Data data = cursor.next();
while (data != null) {
if (data.getDataEventType() == DataEventType.INSERT || data.getDataEventType() == DataEventType.UPDATE) {
Map<String, String> columnData = data.toColumnNameValuePairs(
snapshotTable.getColumnNames(), CsvData.ROW_DATA);

Expand Down Expand Up @@ -534,6 +532,7 @@ public void acknowledgeFiles(OutgoingBatch outgoingBatch) {
}
}
}
data = cursor.next();
}

if (cursor != null) {
Expand Down

0 comments on commit 68646c2

Please sign in to comment.