You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/05/18 18:43:08 UTC

[GitHub] [couchdb] nickva opened a new pull request #3569: Use the last commit result even when there are intermediate retries

nickva opened a new pull request #3569:
URL: https://github.com/apache/couchdb/pull/3569


   Previously, if a transaction got a `commit_unknown_result`, during the next successful attempt that result would be returned to the user. However, if the next attempt was another retryable error, then the committed result was ignored
   and the whole transaction would be applied again. This could result in document update transactions conflicting with themselves as described in issue https://github.com/apache/couchdb/issues/3560
   
   To prevent that from happening we remember that there was an `commit_unknown_result` error during the course of any previous retries and try to return that result.
   


-- 
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:
users@infra.apache.org



[GitHub] [couchdb] iilyak commented on pull request #3569: Use the last commit result even when there are intermediate retries

Posted by GitBox <gi...@apache.org>.
iilyak commented on pull request #3569:
URL: https://github.com/apache/couchdb/pull/3569#issuecomment-844039917


   This solution doesn't match the proposal in the https://github.com/apache/couchdb/issues/3560. Do we know for sure the result we return corresponds to the transaction which succeeded?
   


-- 
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:
users@infra.apache.org



[GitHub] [couchdb] nickva edited a comment on pull request #3569: Use the last commit result even when there are intermediate retries

Posted by GitBox <gi...@apache.org>.
nickva edited a comment on pull request #3569:
URL: https://github.com/apache/couchdb/pull/3569#issuecomment-844234395


   @iilyak Oh good question. 
   
   I think it should always be the last result because as soon as there is at least one `commit_unknown_result` result in the sequence of retries, we will always try to return that result to the user, and not run the transaction closure again https://github.com/apache/couchdb/blob/e5699e5c10bd0131ab9fe3a04bcc1568c1a16186/src/fabric/src/fabric2_fdb.erl#L186
   
   But when we try to return the last result we still have to perform a few FDB operations which would also be an area where retries would be thrown, for example here https://github.com/apache/couchdb/blob/e5699e5c10bd0131ab9fe3a04bcc1568c1a16186/src/fabric/src/fabric2_fdb.erl#L2024 and we don't want those retryable errors to reset the fact that we're still have a commit_unknown_result to handle.


-- 
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:
users@infra.apache.org



[GitHub] [couchdb] nickva edited a comment on pull request #3569: Use the last commit result even when there are intermediate retries

Posted by GitBox <gi...@apache.org>.
nickva edited a comment on pull request #3569:
URL: https://github.com/apache/couchdb/pull/3569#issuecomment-844234395


   @iilyak Oh good question. 
   
   I think it should always be the last commit unknown result because as soon as there is at least one `commit_unknown_result` in the sequence of retries, we will always try to return that result to the user, and not run the transaction closure again https://github.com/apache/couchdb/blob/e5699e5c10bd0131ab9fe3a04bcc1568c1a16186/src/fabric/src/fabric2_fdb.erl#L186
   
   But when we try to return the last result we still have to perform a few FDB operations which would also be an area where retries would be thrown, for example here https://github.com/apache/couchdb/blob/e5699e5c10bd0131ab9fe3a04bcc1568c1a16186/src/fabric/src/fabric2_fdb.erl#L2024 and we don't want those retryable errors to reset the fact that we're still have a commit_unknown_result to handle.


-- 
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:
users@infra.apache.org



[GitHub] [couchdb] nickva merged pull request #3569: Use the last commit result even when there are intermediate retries

Posted by GitBox <gi...@apache.org>.
nickva merged pull request #3569:
URL: https://github.com/apache/couchdb/pull/3569


   


-- 
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:
users@infra.apache.org



[GitHub] [couchdb] nickva commented on pull request #3569: Use the last commit result even when there are intermediate retries

Posted by GitBox <gi...@apache.org>.
nickva commented on pull request #3569:
URL: https://github.com/apache/couchdb/pull/3569#issuecomment-844234395


   @iilyak Oh good question. 
   
   I think it should always be the last result because as soon as there is at least one `commit_unknown_result` commit result in the sequence of retries, we will always try to return that result to the user and not run the transaction closure again https://github.com/apache/couchdb/blob/e5699e5c10bd0131ab9fe3a04bcc1568c1a16186/src/fabric/src/fabric2_fdb.erl#L186
   
   But when we try to return the last result we still have to perform a few FDB operations which would also be an area where retries would be thrown, for example here https://github.com/apache/couchdb/blob/e5699e5c10bd0131ab9fe3a04bcc1568c1a16186/src/fabric/src/fabric2_fdb.erl#L2024 and we don't want those retryable errors to reset the fact that we're still have a commit_unknown_result to handle.


-- 
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:
users@infra.apache.org