Skip to content
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-2206: TestReplicatorDoNotSendDeltaWhenSrcIsTombstone flake #6954

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

gregns1
Copy link
Contributor

@gregns1 gregns1 commented Jul 10, 2024

CBG-2206

  • Test was asserting on 404 missing on fetching the specific rev via rest api. This is incorrect as you will still get 200 code but with _deleted body. Changed test to reflect this + had a check that fetching the doc (and not specifying rev id returned 404)
  • In addition I noticed that on destination when the delete delta was being replicated over, we were patching the empty delta to the revision on the destination. Meaning we would have _deleted in the body but also the old body fields too. The example from the test looked like so:
{"_deleted":true,"_id":"test","_rev":"2-26ddda6a2110ff1a408ebb8d36674b17","field1":"f1_1","field2":"f2_1"}
  • To fix I added statement to only patch if the incoming delta is not a delete.

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Integration Tests

…onality properly. Also a fix for patch on a deleted delta
base.WarnfCtx(bh.loggingCtx, "Error patching deltaSrc %s with %s for doc %s with delta - err: %v", deltaSrcRevID, revID, base.UD(docID), err)
return base.HTTPErrorf(http.StatusUnprocessableEntity, "Error patching deltaSrc with delta: %s", err)
}
if !revMessage.Deleted() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't intend to support deltas for deletes (i.e. if deleted and deltaSrc properties are both specified on an incoming rev message, we should ignore deltaSrc, and perform this check up on line 1016).

@adamcfraser adamcfraser merged commit 798d3aa into main Jul 12, 2024
34 checks passed
@adamcfraser adamcfraser deleted the CBG-2206 branch July 12, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants