You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by sa...@apache.org on 2018/08/07 18:12:40 UTC

[geode] branch develop updated: GEODE-5463: Generated restore.bat script is incorrect for Windows

This is an automated email from the ASF dual-hosted git repository.

sai_boorlagadda pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 619e3cf  GEODE-5463: Generated restore.bat script is incorrect for Windows
619e3cf is described below

commit 619e3cf126fa04122c5a6741fe89fa03bf2014e8
Author: Sai Boorlagadda <sb...@pivotal.io>
AuthorDate: Tue Aug 7 11:11:03 2018 -0700

    GEODE-5463: Generated restore.bat script is incorrect for Windows
    
       ensure that statements creating directories
       are not interpreted as oplog files
    
    Signed-off-by: Jens Deppe <jd...@pivotal.io>
---
 .../geode/internal/cache/backup/BackupInspectorIntegrationTest.java   | 2 +-
 .../org/apache/geode/internal/cache/backup/UnixBackupInspector.java   | 4 ++++
 .../apache/geode/internal/cache/backup/WindowsBackupInspector.java    | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/backup/BackupInspectorIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/backup/BackupInspectorIntegrationTest.java
index 3f66f20..313567a 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/backup/BackupInspectorIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/backup/BackupInspectorIntegrationTest.java
@@ -90,7 +90,7 @@ public class BackupInspectorIntegrationTest {
     assertThat(inspector.isIncremental()).isTrue();
     Set<String> oplogFiles = inspector.getIncrementalOplogFileNames();
     assertThat(oplogFiles.isEmpty()).isFalse();
-    assertThat(oplogFiles).hasSize(3);
+    assertThat(oplogFiles).hasSize(2);
     assertThat(oplogFiles.contains(CRF_FILE_NAME)).isTrue();
     assertThat(oplogFiles.contains(DRF_FILE_NAME)).isTrue();
     validateIncrementalBackupScript(inspector);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/backup/UnixBackupInspector.java b/geode-core/src/main/java/org/apache/geode/internal/cache/backup/UnixBackupInspector.java
index 174ae4c..273bb5c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/backup/UnixBackupInspector.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/backup/UnixBackupInspector.java
@@ -59,6 +59,10 @@ class UnixBackupInspector extends BackupInspector {
     String line;
 
     while (null != (line = reader.readLine())) {
+      if (line.startsWith("mkdir")) {
+        // ensure that statements creating directories is not interpreted as oplog files.
+        continue;
+      }
       int beginIndex = line.lastIndexOf(File.separator) + 1;
       int endIndex = line.length() - 1;
       String oplogName = line.substring(beginIndex, endIndex);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/backup/WindowsBackupInspector.java b/geode-core/src/main/java/org/apache/geode/internal/cache/backup/WindowsBackupInspector.java
index e9238c9..fcf043c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/backup/WindowsBackupInspector.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/backup/WindowsBackupInspector.java
@@ -62,6 +62,7 @@ class WindowsBackupInspector extends BackupInspector {
     String oplogName;
     while (null != (line = reader.readLine())) {
       if (line.startsWith("IF")) {
+        // skip IF statements as they have oplog file exists checks.
         continue;
       } else if (line.contains(WindowsScriptGenerator.EXIT_MARKER)) {
         break;