-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBG-4027 Treat on-demand import for GET errors as not found #6957
Conversation
Ensures that these are correctly handled as norev messages when encountered during replication.
df5ae30
to
f806d9d
Compare
db/crud.go
Outdated
} else if importErr != nil { | ||
return nil, importErr | ||
// Treat any other failure to perform an on-demand import as not found | ||
base.DebugfCtx(ctx, base.KeyImport, "Unable to import doc %q during on demand import for get - will be treated as not found. Reason: %v", base.UD(docid), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's an error that would be 503, like gocb.OverloadError, do we want to skip this doc to not be found again?
Or is the assumption that this would be caught by the traditional import feed and then updated after?
Line 142 in c6b3b3c
return nil, getExpiryErr |
or
https://github.com/couchbase/sync_gateway/blob/main/db/crud.go#L1938 should be able to trigger this behavior if there's a leaky datastore that can return 503s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, if there's a failure to write the doc for an on-demand import, this will fall back to the feed-based import. In this case clients who had requested the previous rev will get a norev, and will get the current rev when it is imported.
db/crud.go
Outdated
} else if importErr != nil { | ||
return nil, importErr | ||
// Treat any other failure to perform an on-demand import as not found | ||
base.DebugfCtx(ctx, base.KeyImport, "Unable to import doc %q during on demand import for get - will be treated as not found. Reason: %v", base.UD(docid), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base.DebugfCtx(ctx, base.KeyImport, "Unable to import doc %q during on demand import for get - will be treated as not found. Reason: %v", base.UD(docid), err) | |
base.DebugfCtx(ctx, base.KeyImport, "Unable to import doc %q during on demand import for get - will be treated as not found. Reason: %v", base.UD(docid), importErr) |
Requested change has been made, reviewed/approved by Greg.
CBG-4027
Ensures that these are correctly handled as norev messages when encountered during replication, as they always represent a case where the requested revision was not available.
Integration Tests
GSI=true,xattrs=true
https://jenkins.sgwdev.com/job/SyncGateway-Integration/2572/