On Wednesday, October 29, 2014 1:40:04 PM UTC-4, Jens Alfke wrote: > > > Aw crap, you're right — it's a mistake in my sample code. The line > CBLUnsavedRevision *newRev = [*current* createRevision]; > should be > CBLUnsavedRevision *newRev = [*rev* createRevision]; > which I think is the same change you made in the code you just posted. > > Yes, that is effectively the same change. However, the conflicts still remain.
Here's the output from one of the runs. What seems odd is that newly saved revisions do not have revision IDs, even after being saved. 13 total Conflicts for: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 Saved current of new revision (null) for revsion 121-0c51102053b54432ea48dad131c5cf86 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 120-c438665ca9877ee388d91fbb71f3d33f of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 119-36bd4f3d615121925ea10e464dff9e84 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 116-b9df055884bcd38a28d4db14582c608a of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 106-06ab0852a09ffd7a74a8679ae9e6d2c6 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 110-5502833a249b6ce4f7ca6e2ea2b40cb7 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 107-0aec4a3c4f6b41af463d052776f70c23 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 118-a8bee8abf22403a04703d29dc8e84325 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 115-4643765c558bddde1eddb0ebd71039c5 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 113-3eb619c463767d3449652dc553c196a9 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 114-b119801ccce39c63560dd7a3576a38ea of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 112-edd492acdcaef62e8fbe83f8c7b7fedd of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Saved non-current of new revision (null) for revsion 111-0ae2df3e9cafc2bb407323ab57e6c2c9 of documment: f8ee7974-9558-4ba4-ba94-6a7ce98c58b4 error:(null) Staring Compact Finished Compact Our of curiosity, I opened the corresponding SQLite file and found 52 revisions for f8ee7974-9558-4ba4-ba94-6a7ce98c58b4. Running the process multiple times does not increase the number of revisions for this document. Furthermore, all of the revisions returning as a conflict above have a parent of NULL in the underlying SQLite database. They also have a "1" in their current column. Nor can I find a corresponding revision with the sequence number for one of these above revisions as its parent, which I would expect the conflict resolution code to create. select * from revs where doc_id = 5574 and current = 1 and parent is null and deleted is not 1 returns all of the revisions marked as a conflict. sequence|doc_id|revid|parent|current|deleted|no_attachments 26015|5574|"111-0ae2df3e9cafc2bb407323ab57e6c2c9"|<NULL>|1|0|1 35199|5574|"112-edd492acdcaef62e8fbe83f8c7b7fedd"|<NULL>|1|0|1 35337|5574|"114-b119801ccce39c63560dd7a3576a38ea"|<NULL>|1|0|1 35338|5574|"113-3eb619c463767d3449652dc553c196a9"|<NULL>|1|0|1 35358|5574|"115-4643765c558bddde1eddb0ebd71039c5"|<NULL>|1|0|1 36748|5574|"118-a8bee8abf22403a04703d29dc8e84325"|<NULL>|1|0|1 36855|5574|"107-0aec4a3c4f6b41af463d052776f70c23"|<NULL>|1|0|1 36859|5574|"110-5502833a249b6ce4f7ca6e2ea2b40cb7"|<NULL>|1|0|1 36860|5574|"106-06ab0852a09ffd7a74a8679ae9e6d2c6"|<NULL>|1|0|1 36861|5574|"116-b9df055884bcd38a28d4db14582c608a"|<NULL>|1|0|1 36870|5574|"119-36bd4f3d615121925ea10e464dff9e84"|<NULL>|1|0|1 36873|5574|"120-c438665ca9877ee388d91fbb71f3d33f"|<NULL>|1|0|1 36879|5574|"121-0c51102053b54432ea48dad131c5cf86"|<NULL>|1|0|1 So we seem to be looking at multiple roots in the revision tree. Is it possible the tree is somehow corrupt for this? -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/b217c5a1-2656-4c7c-aa98-3ea717b2b48f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
