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

ASF GitHub Bot logged work on BEAM-9439:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/May/20 19:26
            Start Date: 07/May/20 19:26
    Worklog Time Spent: 10m 
      Work Description: sgraca commented on a change in pull request #11377:
URL: https://github.com/apache/beam/pull/11377#discussion_r421740373



##########
File path: 
sdks/java/io/kinesis/src/main/java/org/apache/beam/sdk/io/kinesis/ShardRecordsIterator.java
##########
@@ -43,22 +42,23 @@
   private final RecordFilter filter;
   private final String streamName;
   private final String shardId;
-  private AtomicReference<ShardCheckpoint> checkpoint;
+  private final AtomicReference<ShardCheckpoint> checkpoint;
+  private final WatermarkPolicy watermarkPolicy;

Review comment:
       I don't know why it was used in the first place, maybe it was some 
leftover after some previous changes to the code. The value of 
`watermarkPolicy` is only set in constructor and then only accessed (never 
changed), so there's no need to have an `AtomicReference` for that. From the 
perspective of memory visiblity, making the field as `final` ensures that the 
value of the field is correctly published to other threads, so there's no 
difference also in that aspect.




----------------------------------------------------------------
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: 431868)
    Time Spent: 1h 40m  (was: 1.5h)

> KinesisReader does not report correct backlog statistics 
> ---------------------------------------------------------
>
>                 Key: BEAM-9439
>                 URL: https://issues.apache.org/jira/browse/BEAM-9439
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-kinesis
>            Reporter: Sam Whittle
>            Assignee: Sebastian Graca
>            Priority: Major
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> The KinesisReader implementing KinesisIO reports backlog by implementing the
> UnboundedSource.getTotalBacklogBytes()
> method as opposed to the
> UnboundedSource.getSplitBacklogBytes()
> This value is supposed to represent the total backlog across all shards.  
> This function is implemented by calling 
> SimplifiedKinesisClient.getBacklogBytes with the watermark of the kinesis 
> shards managed within the UnboundedReader instance.  As this watermark may be 
> further ahead than the watermark across all shards, this may miss backlog 
> bytes.
> An additional concern is that the watermark is calculated using a 
> WatermarkPolicy, which means that the watermark may be inconsistent to the 
> kinesis timestamp for querying backlog.



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

Reply via email to