Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
7e3410ad
Commit
7e3410ad
authored
7 months ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
doc: add comments to retriable error codes explaing why they are retriable
parent
2e89c858
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1246
cleanup a bunch of stuff related to compare and swap requests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
picoplugin/src/error_code.rs
+16
-4
16 additions, 4 deletions
picoplugin/src/error_code.rs
with
16 additions
and
4 deletions
picoplugin/src/error_code.rs
+
16
−
4
View file @
7e3410ad
...
...
@@ -80,11 +80,23 @@ impl ErrorCode {
#[inline]
pub
fn
is_retriable_for_cas
(
&
self
)
->
bool
{
match
*
self
{
ErrorCode
::
RaftLogCompacted
|
ErrorCode
::
CasConflictFound
// Raft leader has changed since the CaS request was generated.
// The client should synchronize and retry the request.
ErrorCode
::
NotALeader
// Raft log was compacted on the leader, so the predicate cannot be checked.
// The client should synchronize and retry the request.
|
ErrorCode
::
RaftLogCompacted
// Some raft log entries have disappeared on the leader, so the predicate cannot be checked.
// XXX Not sure how this would happen.
// The client should synchronize and retry the request.
|
ErrorCode
::
RaftLogUnavailable
// Entry at requested index has a mismatched term in the leader's log.
// The client should synchronize ( raft log will likely be truncated) and retry the request.
|
ErrorCode
::
CasEntryTermMismatch
|
ErrorCode
::
NotALeader
|
ErrorCode
::
RaftLogUnavailable
=>
true
,
// Leader checked the predicate and found a conflict.
// The client should synchronize and check the preconditions.
|
ErrorCode
::
CasConflictFound
=>
true
,
_
=>
false
,
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment