[ https://issues.apache.org/jira/browse/HADOOP-18183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17633643#comment-17633643 ]
ASF GitHub Bot commented on HADOOP-18183: ----------------------------------------- dannycjones commented on code in PR #5110: URL: https://github.com/apache/hadoop/pull/5110#discussion_r1021284548 ########## hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/audit/impl/LoggingAuditor.java: ########## @@ -230,6 +240,26 @@ private class LoggingAuditSpan extends AbstractAuditSpanImpl { private final HttpReferrerAuditHeader referrer; + /** + * Attach Range of data for GetObject Request. + * @param request given get object request + */ + private void attachRangeFromRequest(AmazonWebServiceRequest request) { + if (request instanceof GetObjectRequest) { + long[] rangeValue = ((GetObjectRequest) request).getRange(); + if (rangeValue == null || rangeValue.length == 0) { + return; + } + if (rangeValue.length != 2) { + WARN_INCORRECT_RANGE.warn("Expected range to contain 0 or 2 elements. Got " + + rangeValue.length + " elements. Ignoring"); + return; + } + String combinedRangeValue = String.format("bytes=%d-%d", rangeValue[0], rangeValue[1]); Review Comment: @steveloughran, can you elaborate on the `rg` prefix? Is it for the query parameter? If so, we already have that as `r` (`PARAM_RANGE`). `bytes=` is part of the range header value which - following the SDK upgrade - can just be dumped in place, without needing reconstruction like this. That being said, it does seem a bit of a waste. Maybe we drop it entirely here (and for all connectors) and just include whatever the value of the range header was minus `bytes=` prefix. > s3a audit logs to publish range start/end of GET requests in audit header > ------------------------------------------------------------------------- > > Key: HADOOP-18183 > URL: https://issues.apache.org/jira/browse/HADOOP-18183 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs/s3 > Affects Versions: 3.3.2 > Reporter: Steve Loughran > Assignee: Ankit Saurabh > Priority: Minor > Labels: pull-request-available > > we don't get the range of ranged get requests in s3 server logs, because the > AWS s3 log doesn't record that information. we can see it's a partial get > from the 206 response, but the length of data retrieved is lost. > LoggingAuditor.beforeExecution() would need to recognise a ranged GET and > determine the extra key-val pairs for range start and end (rs & re?) > we might need to modify {{HttpReferrerAuditHeader.buildHttpReferrer()}} to > take a map of <string, string> so it can dynamically create a header for each > request; currently that is not in there. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org