dcapwell commented on code in PR #3502:
URL: https://github.com/apache/cassandra/pull/3502#discussion_r1733431497
##########
src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:
##########
@@ -844,11 +844,23 @@ private Pair<State, Processor> delegateInternal()
@Override
public Commit.Result commit(Entry.Id entryId, Transformation
transform, Epoch lastKnown, Retry.Deadline retryPolicy)
{
- Pair<State, Processor> delegate = delegateInternal();
- Commit.Result result = delegate.right.commit(entryId, transform,
lastKnown, retryPolicy);
- if (delegate.left == LOCAL || delegate.left == RESET)
- replicator.send(result, null);
- return result;
+ while (!retryPolicy.reachedMax())
Review Comment:
@ifesdjeen you might want to look here. You provided the following feedback
in https://github.com/apache/cassandra/pull/3486
> I think we should not retry here, and instead should retry in an
underlying processor. But maybe this is one of the Marcus's patches.
https://github.com/apache/cassandra/pull/3486#discussion_r1732683533
##########
src/java/org/apache/cassandra/tcm/ClusterMetadataService.java:
##########
@@ -844,11 +844,23 @@ private Pair<State, Processor> delegateInternal()
@Override
public Commit.Result commit(Entry.Id entryId, Transformation
transform, Epoch lastKnown, Retry.Deadline retryPolicy)
{
- Pair<State, Processor> delegate = delegateInternal();
- Commit.Result result = delegate.right.commit(entryId, transform,
lastKnown, retryPolicy);
- if (delegate.left == LOCAL || delegate.left == RESET)
- replicator.send(result, null);
- return result;
+ while (!retryPolicy.reachedMax())
+ {
+ try
+ {
+ Pair<State, Processor> delegate = delegateInternal();
+ Commit.Result result = delegate.right.commit(entryId,
transform, lastKnown, retryPolicy);
+ ClusterMetadataService.State state = delegate.left;
+ if (state == LOCAL || state == RESET)
+ replicator.send(result, null);
+ return result;
+ }
+ catch (NotCMSException e)
+ {
+ retryPolicy.maybeSleep();
+ }
+ }
+ return Commit.Result.failed(ExceptionCode.SERVER_ERROR, "Could not
commit " + transform.kind() + " at epoch " + lastKnown);
Review Comment:
@ifesdjeen you might want to look here. You provided the following feedback
in https://github.com/apache/cassandra/pull/3486
> nit: should we use string format here?
https://github.com/apache/cassandra/pull/3486#discussion_r1732676610
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]