5

I have a user that today is not replicating the new documents that the others users are adding on my CoucDB database, in other words the user A does not see the docuemnts that the users B, C is adding every day.

I have seen the last document added from the user A to CouchDB and I have seen that the document has a new field

_conflicts: ["2-17d3fcec15fbe3b1eed3e7f8a14eae35"]}

enter image description here

I guess the conflict is in the second revision of the document, Is not it? I have 7 revision about the same document my question is How I can resolve it? How I can remove this conflict?

Mike Torrettinni
  • 1,816
  • 2
  • 17
  • 47
JoCuTo
  • 2,463
  • 4
  • 28
  • 44

1 Answers1

2

CouchDB does not attempt to merge the conflicting revision.

Your application dictates how the merging should be done.

see http://docs.couchdb.org/en/2.0.0/replication/conflicts.html

but generaly speaking the suggested algorithm to fetch a document with conflict resolution:

  • Get document via GET docid?conflicts=true request;
  • For each member in the _conflicts array call GET docid?rev=xxx. If any errors occur at this stage, restart from step 1. (There could be a race where someone else has already resolved this conflict and deleted that rev)
  • Perform application-specific merging
  • Write _bulk_docs with an update to the first rev and deletes of the other revs.

alos see the version on ruby

venergiac
  • 7,469
  • 2
  • 48
  • 70
  • 1
    in all the revision the documents are equal, just change the revion field and id field, so could I delete the revision doc and just keep the last one, I mean I have revison 1,2,3,4,5,6,7 I will deleted 1,2,3,4,5,6 and keep the revision 7 – JoCuTo Jan 22 '18 at 16:58