You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by ja...@apache.org on 2019/06/13 22:39:35 UTC

[samza] branch master updated: SAMZA-2242: Improve logging on offset-file code-path

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

jagadish pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/samza.git


The following commit(s) were added to refs/heads/master by this push:
     new e4d0ad1  SAMZA-2242: Improve logging on offset-file code-path
e4d0ad1 is described below

commit e4d0ad11ca360e429f14e291074147dc04dd7fe7
Author: Yang Zhang <ya...@linkedin.com>
AuthorDate: Thu Jun 13 15:39:31 2019 -0700

    SAMZA-2242: Improve logging on offset-file code-path
    
    Author: Yang Zhang <ya...@linkedin.com>
    
    Reviewers: Jagadish <ja...@apache.org>
    
    Closes #1075 from ghostli123/master
---
 .../java/org/apache/samza/storage/StorageManagerUtil.java    | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/samza-core/src/main/java/org/apache/samza/storage/StorageManagerUtil.java b/samza-core/src/main/java/org/apache/samza/storage/StorageManagerUtil.java
index c064a8e..293b9ab 100644
--- a/samza-core/src/main/java/org/apache/samza/storage/StorageManagerUtil.java
+++ b/samza-core/src/main/java/org/apache/samza/storage/StorageManagerUtil.java
@@ -145,10 +145,16 @@ public class StorageManagerUtil {
     boolean hasValidOffsetFile = false;
     if (storeDir.exists()) {
       Map<SystemStreamPartition, String> offsetContents = readOffsetFile(storeDir, storeSSPs, isSideInput);
-      if (offsetContents != null && !offsetContents.isEmpty() && offsetContents.keySet().equals(storeSSPs)) {
-        hasValidOffsetFile = true;
+      if (offsetContents == null) {
+        LOG.info("Offset file does not exist. Store directory: {}", storeDir.toPath());
+      } else if (offsetContents.isEmpty()) {
+        LOG.info("Offset file is empty. Store directory: {}", storeDir.toPath());
+      } else if (!offsetContents.keySet().equals(storeSSPs)) {
+        LOG.info("Offset file is invalid since change-log SSPs don't match. "
+            + "Store directory: {}. SSPs from offset-file: {} SSPs expected: {} ",
+            storeDir.toPath(), offsetContents.keySet(), storeSSPs);
       } else {
-        LOG.info("Offset file is not valid for store: {}.", storeDir.toPath());
+        hasValidOffsetFile = true;
       }
     }