tianz101 commented on code in PR #37459:
URL: https://github.com/apache/beam/pull/37459#discussion_r2760481083
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/action/QueryChangeStreamAction.java:
##########
@@ -195,13 +199,17 @@ public ProcessContinuation run(
final Timestamp endTimestamp = partition.getEndTimestamp();
final boolean isBoundedRestriction =
!endTimestamp.equals(MAX_INCLUSIVE_END_AT);
final Timestamp changeStreamQueryEndTimestamp =
- isBoundedRestriction ? endTimestamp :
getNextReadChangeStreamEndTimestamp();
+ isBoundedRestriction
+ ? getBoundedQueryEndTimestamp(endTimestamp)
+ : getNextReadChangeStreamEndTimestamp();
// Once the changeStreamQuery completes we may need to resume reading from
the partition if we
// had an unbounded restriction for which we set an arbitrary query end
timestamp and for which
// we didn't encounter any indications that the partition is done
(explicit end records or
// exceptions about being out of timestamp range).
- boolean stopAfterQuerySucceeds = isBoundedRestriction;
+ boolean stopAfterQuerySucceeds =
+ isBoundedRestriction &&
changeStreamQueryEndTimestamp.equals(endTimestamp);
Review Comment:
For v1, this changeStreamQueryEndTimestamp.equals(endTimestamp) is valid.
For v2, this changeStreamQueryEndTimestamp.equals(endTimestamp) may never
happen. Is that intended?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]