Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Conversation

@igorbernstein2
Copy link
Contributor

This will allow the streaming retries to be useful in more scenarios.

The general use cases for this are:

  1. If a stream can only be resumed from a particular point, then its strategy will resume from the closest point, suppressing the repeated messages in the retry
  2. If the stream elements have sequence numbers relative to the start of the stream, then strategy can re-write the sequence numbers when it performs a retry.

The specific use case is to enable retries for Bigtable's MutateRows RPC. Which has a batch request and streamed responses. Each entry can fail independently of the others. I would like to reuse the streaming retry infrastructure to implement retries. On failure, the strategy will find all of the failed subresponses and compose a new request with them. The responses will have to be rewritten to adjust indexes on the response entries.

…oming response stream.

The general use cases for this are:

1. If a stream can only be resumed from a particular point, then its strategy will resume from the closest point, suppressing the repeated messages in the retry
2. If the stream elements have sequence numbers relative to the start of the stream, then strategy can re-write the sequence numbers when it performs a retry.

The specific use case is to enable retries for Bigtable's MutateRows RPC. Which has a batch request and streamed responses. Each entry can fail independently of the others. I would like to reuse the streaming retry infrastructure to implement retries. On failure, the strategy will find all of the failed subresponses and compose a new request with them. The responses will have to be rewritten to adjust indexes on the response entries.
@codecov-io
Copy link

codecov-io commented Feb 22, 2018

Codecov Report

Merging #485 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #485      +/-   ##
============================================
+ Coverage     70.34%   70.34%   +<.01%     
- Complexity      773      774       +1     
============================================
  Files           162      162              
  Lines          3672     3676       +4     
  Branches        275      278       +3     
============================================
+ Hits           2583     2586       +3     
  Misses          973      973              
- Partials        116      117       +1
Impacted Files Coverage Δ Complexity Δ
...i/gax/retrying/SimpleStreamResumptionStrategy.java 14.28% <0%> (ø) 1 <0> (ø) ⬇️
...le/api/gax/rpc/ServerStreamingAttemptCallable.java 87.03% <80%> (-0.47%) 18 <3> (+1)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8b4666...345cd50. Read the comment docs.

if (message == null) {
// Request the next one and exit
if (!autoFlowControl) {
innerController.request(1);

This comment was marked as spam.

@igorbernstein2
Copy link
Contributor Author

@garrettjonesgoogle can you take a look at this? It's in prep for implementing flushing for BulkMutations in the bigtable client

* accomplishes two goals:
*
* <ol>
* <li>It allows the strategy implementation to update it's internal state so that it can

This comment was marked as spam.

* <ol>
* <li>It allows the strategy implementation to update it's internal state so that it can
* compose the resume request
* <li>It allows the strategy to alter the incoming responses to adjust for post resume. For

This comment was marked as spam.

innerController.request(1);
}
return;
}

This comment was marked as spam.

@igorbernstein2
Copy link
Contributor Author

Would a separate ‘shouldSkip(ResponseT)’ on the strategy be better? I don’t actually care for the suppression functionality, I only need to be able rewrite responses for bigtable. I added it just in case it might be useful. Should I just remove it?

@garrettjonesgoogle
Copy link
Member

Yeah, if we don't have a need for it yet, let's remove it.

@igorbernstein2
Copy link
Contributor Author

Ok, all feedback should be addressed

Copy link
Member

@garrettjonesgoogle garrettjonesgoogle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@garrettjonesgoogle garrettjonesgoogle merged commit 7d0a0a0 into googleapis:master Feb 24, 2018
igorbernstein2 added a commit to igorbernstein2/gax-java that referenced this pull request Mar 12, 2018
@igorbernstein2 igorbernstein2 deleted the retries-response-mod branch March 18, 2018 06:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants