[ https://issues.apache.org/jira/browse/HIVE-22990?focusedWorklogId=404941&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-404941 ]
ASF GitHub Bot logged work on HIVE-22990: ----------------------------------------- Author: ASF GitHub Bot Created on: 17/Mar/20 20:22 Start Date: 17/Mar/20 20:22 Worklog Time Spent: 10m Work Description: pkumarsinha commented on pull request #949: HIVE-22990 Add file based ack for replication URL: https://github.com/apache/hive/pull/949#discussion_r393848763 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java ########## @@ -429,36 +428,19 @@ private Path getCurrentLoadPath() throws IOException, SemanticException { } FileStatus[] statuses = loadPathBase.getFileSystem(conf).listStatus(loadPathBase); if (statuses.length > 0) { - //sort based on last modified. Recent one is at the end - Arrays.sort(statuses, new Comparator<FileStatus>() { - public int compare(FileStatus f1, FileStatus f2) { - return Long.compare(f1.getModificationTime(), f2.getModificationTime()); + //sort based on last modified. Recent one is at the beginning + FileStatus latestUpdatedStatus = statuses[0]; + for (FileStatus status : statuses) { + if (status.getModificationTime() > latestUpdatedStatus.getModificationTime()) { + latestUpdatedStatus = status; } - }); - if (replScope.getDbName() != null) { - String currentReplStatusOfTarget - = getReplStatus(replScope.getDbName()); - if (currentReplStatusOfTarget == null) { //bootstrap - return new Path(statuses[0].getPath(), ReplUtils.REPL_HIVE_BASE_DIR); - } else { - DumpMetaData latestDump = new DumpMetaData( - new Path(statuses[statuses.length - 1].getPath(), ReplUtils.REPL_HIVE_BASE_DIR), conf); - if (Long.parseLong(currentReplStatusOfTarget.trim()) >= latestDump.getEventTo()) { - isTargetAlreadyLoaded = true; - } else { - for (FileStatus status : statuses) { - Path hiveLoadPath = new Path(status.getPath(), ReplUtils.REPL_HIVE_BASE_DIR); - DumpMetaData dmd = new DumpMetaData(hiveLoadPath, conf); - if (dmd.isIncrementalDump() - && Long.parseLong(currentReplStatusOfTarget.trim()) < dmd.getEventTo()) { - return hiveLoadPath; - } - } - } + } + Path hiveDumpPath = new Path(latestUpdatedStatus.getPath(), ReplUtils.REPL_HIVE_BASE_DIR); + if (loadPathBase.getFileSystem(conf).exists(hiveDumpPath)) { Review comment: Why do we need this check? Aren't other two checks below good enough? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 404941) Time Spent: 5h 10m (was: 5h) > Build acknowledgement mechanism for repl dump and load > ------------------------------------------------------ > > Key: HIVE-22990 > URL: https://issues.apache.org/jira/browse/HIVE-22990 > Project: Hive > Issue Type: Bug > Reporter: Aasha Medhi > Assignee: Aasha Medhi > Priority: Major > Labels: pull-request-available > Attachments: HIVE-22990.01.patch, HIVE-22990.02.patch, > HIVE-22990.03.patch, HIVE-22990.04.patch, HIVE-22990.05.patch, > HIVE-22990.06.patch, HIVE-22990.07.patch, HIVE-22990.08.patch, > HIVE-22990.09.patch, HIVE-22990.10.patch, HIVE-22990.11.patch, > HIVE-22990.12.patch, HIVE-22990.13.patch, HIVE-22990.14.patch, > HIVE-22990.15.patch, HIVE-22990.16.patch, HIVE-22990.17.patch, > HIVE-22990.18.patch, HIVE-22990.19.patch, HIVE-22990.20.patch, > HIVE-22990.21.patch, HIVE-22990.22.patch, HIVE-22990.23.patch, > HIVE-22990.patch > > Time Spent: 5h 10m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)