[ 
https://issues.apache.org/jira/browse/HADOOP-17332?focusedWorklogId=515688&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-515688
 ]

ASF GitHub Bot logged work on HADOOP-17332:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Nov/20 17:49
            Start Date: 23/Nov/20 17:49
    Worklog Time Spent: 10m 
      Work Description: bgaborg commented on a change in pull request #2425:
URL: https://github.com/apache/hadoop/pull/2425#discussion_r528888051



##########
File path: 
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/tools/ITestMarkerTool.java
##########
@@ -259,8 +259,25 @@ public void testRunAuditWithExpectedMarkers() throws 
Throwable {
         AUDIT,
         m(OPT_LIMIT), 0,
         m(OPT_OUT), audit,
-        m(OPT_MIN), expectedMarkersWithBaseDir,
-        m(OPT_MAX), expectedMarkersWithBaseDir,
+        m(OPT_MIN), expectedMarkersWithBaseDir - 1,
+        m(OPT_MAX), expectedMarkersWithBaseDir + 1,
+        createdPaths.base);
+    expectMarkersInOutput(audit, expectedMarkersWithBaseDir);
+  }
+
+  @Test
+  public void testRunAuditWithExpectedMarkersSwappedMinMax() throws Throwable {

Review comment:
       I wanted to ask for a test like this, but it's already here so LGTM.

##########
File path: 
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/tools/MarkerTool.java
##########
@@ -513,6 +526,11 @@ private ScanResult scan(
       final DirectoryPolicy filterPolicy)
       throws IOException, ExitUtil.ExitException {
 
+    // safety check: min and max are correctly ordered at this point.
+    Preconditions.checkArgument(minMarkerCount <= maxMarkerCount,

Review comment:
       it will harm nobody, we can leave this check here.
   




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 515688)
    Time Spent: 1.5h  (was: 1h 20m)

> S3A marker tool mixes up -min and -max
> --------------------------------------
>
>                 Key: HADOOP-17332
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17332
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>    Affects Versions: 3.3.1
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>            Priority: Trivial
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> HADOOP-17227 manages to get -min and -max mixed up through the call chain,. 
> {code}
> hadoop s3guard markers -audit -max 2000  s3a://stevel-london/
> {code}
> leads to
> {code}
> 2020-10-27 18:11:44,434 [main] DEBUG s3guard.S3GuardTool 
> (S3GuardTool.java:main(2154)) - Exception raised
> 46: Marker count 0 out of range [2000 - 0]
>       at 
> org.apache.hadoop.fs.s3a.tools.MarkerTool$ScanResult.finish(MarkerTool.java:489)
>       at org.apache.hadoop.fs.s3a.tools.MarkerTool.run(MarkerTool.java:318)
>       at 
> org.apache.hadoop.fs.s3a.s3guard.S3GuardTool.run(S3GuardTool.java:505)
>       at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
>       at 
> org.apache.hadoop.fs.s3a.s3guard.S3GuardTool.run(S3GuardTool.java:2134)
>       at 
> org.apache.hadoop.fs.s3a.s3guard.S3GuardTool.main(S3GuardTool.java:2146)
> 2020-10-27 18:11:44,436 [main] INFO  util.ExitUtil 
> (ExitUtil.java:terminate(210)) - Exiting with status 46: 46: Marker count 0 
> out of range [2000 - 0]
> {code}
> Trivial fix.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to