Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upgrades NuRaft to v2.1.0.
This upgrade caused a failing assertion in the
raft_node_test_non_blocking
unit test. I claim that this assertion in the non_blocking test was actually misguided, and as written, should have always failed in the non_blocking context (or more accurately, the assertion gave insufficient information about whether the task completed correctly).This test fails because when getting the result code of a replication which is asynchronous, if the result has not been written yet, the return value is not cmd_result_code::OK (it becomes
cmd_result_code::RESULT_NOT_EXIST_YET
). In the non-blocking context, this should not prompt a failure, specifically withnode::replicate_sync
written as it is currently. The reason this does not fail with v1.3 is becausecmd_result_code::RESULT_NOT_EXIST_YET
did not exist, andget_result_code()
returned the default value ofcmd_result_code
, which appeared to becmd_result_code::OK
.Would appreciate feedback about whether we should re-write
replicate_sync
to be blocking in a non-blocking node, and wait to see if the result code is truly OK before proceeding. It does not seem like this has been the case to this point (but I have a hunch that it should be), but happy to be wrong on this point. This change is not included in this PR at the time of writing.