[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997217#comment-12997217 ] Bob Dionne commented on COUCHDB-462: I started reworking couch_key_tree[1] as suggested, to try and tease out some fold style functions. This should probably be done in COUCHDB-988 but I wanted to use has_conflicts as one of the tests. I'm able to refactor 4 or 5 so far but it required two types of fold. I'm calling them foldl and foldr for now (no relation to lists:foldl and lists:foldr). So far the results are mixed in that I haven't reduced the amount of code. I'm sticking to just reworking the functions in couch_key_tree internally and not changing how they interact with the rest of the code. It could turn out that some rework of how couch_key_tree is might result in a simpler couch_key_tree. [1] https://github.com/bdionne/couchdb/commits/462 > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, COUCHDB-462-adam-updated.patch, > COUCHDB-462-jan.patch, conflicts_in_db_info.diff, conflicts_in_db_info2.diff, > conflicts_view.diff, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997225#comment-12997225 ] Bob Dionne commented on COUCHDB-462: that last sentence should read: of how couch_key_tree is used might result. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, COUCHDB-462-adam-updated.patch, > COUCHDB-462-jan.patch, conflicts_in_db_info.diff, conflicts_in_db_info2.diff, > conflicts_view.diff, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994657#comment-12994657 ] Adam Kocoloski commented on COUCHDB-462: As mentioned in COUCHDB-1065, that bug is only triggered is a user tries to purge a strict subset of the leaf revisions of a document. I imagine that's a very unusual use case, which may help explain why we've never seen this reported. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, COUCHDB-462-adam-updated.patch, > COUCHDB-462-jan.patch, conflicts_in_db_info.diff, conflicts_in_db_info2.diff, > conflicts_view.diff, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993940#comment-12993940 ] Bob Dionne commented on COUCHDB-462: Looking over the couch_key_tree functions we see a problem with map_leafs. It takes a function that's expected to have two arguments. However in the one place it's called, couch_db_updater:handle_call({purge_docs... it looks like it's being passed a function of one argument. The one likely test that might exercise this path, purge.js, does not. Is this dead code or a potential bug? This code has been there for a while > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, COUCHDB-462-adam-updated.patch, > COUCHDB-462-jan.patch, conflicts_in_db_info.diff, conflicts_in_db_info2.diff, > conflicts_view.diff, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12990524#comment-12990524 ] Bob Dionne commented on COUCHDB-462: Thanks Adam, Here's a fix[1] for both issues you mention, and a few more etaps to test it. Looking over couch_key_tree I agree with you and Randall that many funs have similar shapes and it could likely use a fold. I'll look at that next. I'm not sure about using throw in Erlang. I know in Java where try/catch is enforced I've used it for precisely this case where you want out of a recursion based on some condition. Erlang has a different approach to failure. I'll look into it. What' s really needed in these cases is Scheme's call-with-current-continuation. Cheers, Bob [1] https://github.com/bdionne/couchdb/commit/593bcde1b4.patch > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, COUCHDB-462-adam-updated.patch, > COUCHDB-462-jan.patch, conflicts_in_db_info.diff, conflicts_in_db_info2.diff, > conflicts_view.diff, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12989212#comment-12989212 ] Adam Kocoloski commented on COUCHDB-462: Hi Bob, thanks. I see a couple of problems with the patch: 1) https://github.com/bdionne/couchdb/commit/31a5672#L2R337 It looks like you're incrementing when deleted=true, rather than false. 2) https://github.com/bdionne/couchdb/commit/31a5672#L2R331 I think you're double-counting by passing N + NextN to count_non_deleted/2. More broadly, and in the context of COUCHDB-988, I'm wondering if many of these key tree operations could benefit from a refactoring that adds a generalized couch_key_tree:fold function. I believe Randall Leeds wrote such a thing at one point in time. I'm picturing a fold that supports short-circuiting, possibly using the {ok, _} and {stop, _} tagged tuples convention from couch_btree. ... Actually, digressing a bit further, I'm curious if anyone has ever considered the tradeoffs of different methods of short-circuiting. The tagged tuples are one approach, but it could also be implemented with erlang:throw/1. I'd expect that when short-circuiting is rare throwing an exception is the preferred approach because it creates less garbage along the way. I'm not sure what would be best when short-circuiting is routine (e.g. in the btree). > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, COUCHDB-462-adam-updated.patch, > COUCHDB-462-jan.patch, conflicts_in_db_info.diff, conflicts_in_db_info2.diff, > conflicts_view.diff, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988878#comment-12988878 ] Bob Dionne commented on COUCHDB-462: Here's a new version that only walks the revision tree until conflicts are detected. [1] https://github.com/bdionne/couchdb/tree/couchdb-462 > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, COUCHDB-462-adam-updated.patch, > COUCHDB-462-jan.patch, conflicts_in_db_info.diff, conflicts_in_db_info2.diff, > conflicts_view.diff, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
still a good idea, I think I have a version that does this short-circuiting. Makes you want Scheme's call/cc :) On Jan 30, 2011, at 2:01 PM, Adam Kocoloski (JIRA) wrote: > >[ > https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988635#action_12988635 > ] > > Adam Kocoloski commented on COUCHDB-462: > > > Ah, scratch that - we need to check if the leaf of the conflict edit branch > has been deleted, of course. Oh well. > >> track conflict count in db_info (was built-in conflicts view) >> - >> >>Key: COUCHDB-462 >>URL: https://issues.apache.org/jira/browse/COUCHDB-462 >>Project: CouchDB >> Issue Type: Improvement >> Components: HTTP Interface >> Reporter: Adam Kocoloski >>Fix For: 1.2 >> >>Attachments: 462-jan-2.patch, conflicts_in_db_info.diff, >> conflicts_in_db_info2.diff, conflicts_view.diff, >> COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch, whitespace.diff >> >> >> This patch adds a built-in _conflicts view indexed by document ID that looks >> like >> GET /dbname/_conflicts >> {"rows":[ >> {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", >> "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} >> ]} >> GET /dbname/_conflicts?deleted=true >> {"rows":[ >> {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", >> "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], >> "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, >> {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, >> "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} >> ]} >> As the HTTPd and view layers are a bit outside my specialty I figured I >> should ask for a Review before Commit. > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. >
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988635#action_12988635 ] Adam Kocoloski commented on COUCHDB-462: Ah, scratch that - we need to check if the leaf of the conflict edit branch has been deleted, of course. Oh well. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_in_db_info.diff, > conflicts_in_db_info2.diff, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988634#action_12988634 ] Adam Kocoloski commented on COUCHDB-462: Hi Bob, thanks for following up on this. Yes, we want to fix trailing whitespace issues, thanks for breaking those out into a separate patch. There's still a lot going on in the conflicts_in_db_info2.diff, not all of which is strictly needed for this issue. Ultimately we're going to need separate patches for 902/988 and this issue. So, the idea has evolved into reporting the number of documents with at least one conflict, rather than the total number of losing edit branches in the DB. I think that's the right move, but I also think it means we can write a more efficient reduce function by short-circuiting the evaluation as soon as we see a fork in the tree. I haven't tested it, but maybe the following will work. It should be substantially faster for documents with lots of long edit branches: -spec has_conflicts([path()]) -> boolean(). has_conflicts([{_, RootOfBranch}]) -> has_forks(RootOfBranch); has_conflicts(_MultiplePaths) -> true. -spec has_forks(branch()) -> boolean(). has_forks({_Key, _Value, []}) -> false; has_forks({_Key, _Value, [SubBranch]}) -> has_forks(SubBranch); has_forks({_Key, _Value, [_|_] = _ForkedTree}) -> true. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_in_db_info.diff, > conflicts_in_db_info2.diff, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch, whitespace.diff > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988509#action_12988509 ] Adam Kocoloski commented on COUCHDB-462: Hi Bob, that diff did not apply for me. Can you rebase your branch against trunk and try again? A version without the whitespace differences would also be good. One way to do that is to use the -p option to `git add` and interactively select only the substantive changes. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_in_db_info.diff, > conflicts_view.diff, COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986592#action_12986592 ] Paul Joseph Davis commented on COUCHDB-462: --- Unless I'm reading that wrong, it looks to be counting the number of nodes where the last element is in conflict. Also, the first clause would appear to be have an incorrect pattern match on the accumulator. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986552#action_12986552 ] Bob Dionne commented on COUCHDB-462: Paul, good suggestion. Here's a version that does something like that. Cheers, Bob [1] https://github.com/bdionne/couchdb/commit/9c5eb734bb1515 > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986504#action_12986504 ] Paul Joseph Davis commented on COUCHDB-462: --- @Bob2 But for a "status of databases" page infographic dealy point of view, it'd probably be good to have this number in there. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986498#action_12986498 ] Robert Newson commented on COUCHDB-462: --- One concern. "Oh, I have 10 conflicts! Which documents are they?". They'll have to write a view to find out, and that view would also give them the number proposed here. Discuss. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986492#action_12986492 ] Adam Kocoloski commented on COUCHDB-462: Ah, good point Paul. I think counting the number of documents in conflict is preferable. > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986466#action_12986466 ] Paul Joseph Davis commented on COUCHDB-462: --- OMG WHITESPACE CHANGES! The one thing that I see being potentially confusing (if I'm reading this correctly) is that it's counting the number of conflicted revisions which is not the same as "documents in conflict". Perhaps that could be confusing to people? > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
[ https://issues.apache.org/jira/browse/COUCHDB-462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12986439#action_12986439 ] Bob Dionne commented on COUCHDB-462: We have a new approach to surfacing conflict counts in the db_info object, using the recent refactoring work on couch_key_tree. Have a look, it's dependent on the last patch I submitted for COUCHDB-988 and it still needs an etap but I'll submit it as a patch if folks think it useful. It strikes me as a very useful feature. Cheers, Bob [1] https://github.com/bdionne/couchdb/commit/2405b3bd2ef86e689912c8f > track conflict count in db_info (was built-in conflicts view) > - > > Key: COUCHDB-462 > URL: https://issues.apache.org/jira/browse/COUCHDB-462 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface >Reporter: Adam Kocoloski > Fix For: 1.2 > > Attachments: 462-jan-2.patch, conflicts_view.diff, > COUCHDB-462-adam-updated.patch, COUCHDB-462-jan.patch > > > This patch adds a built-in _conflicts view indexed by document ID that looks > like > GET /dbname/_conflicts > {"rows":[ > {"id":"foo", "rev":"1-1aa8851c9bb2777e11ba56e0bf768649", > "conflicts":["1-bdc15320c0850d4ee90ff43d1d298d5d"]} > ]} > GET /dbname/_conflicts?deleted=true > {"rows":[ > {"id":"bar", "rev":"5-dd31186f5aa11ebd47eb664fb342f1b1", > "conflicts":["5-a0efbb1990c961a078dc5308d03b7044"], > "deleted_conflicts":["3-bdc15320c0850d4ee90ff43d1d298d5d","2-cce334eeeb02d04870e37dac6d33198a"]}, > {"id":"baz", "rev":"2-eec205a9d413992850a6e32678485900", "deleted":true, > "deleted_conflicts":["2-10009b36e28478b213e04e71c1e08beb"]} > ]} > As the HTTPd and view layers are a bit outside my specialty I figured I > should ask for a Review before Commit. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.