couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kocoloski (JIRA)" <>
Subject [jira] Commented: (COUCHDB-462) track conflict count in db_info (was built-in conflicts view)
Date Sun, 30 Jan 2011 18:59:47 GMT


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_conflicts(_MultiplePaths) ->

-spec has_forks(branch()) -> boolean().
has_forks({_Key, _Value, []}) ->
has_forks({_Key, _Value, [SubBranch]}) ->
has_forks({_Key, _Value, [_|_] = _ForkedTree}) ->

> track conflict count in db_info (was built-in conflicts view)
> -------------------------------------------------------------
>                 Key: COUCHDB-462
>                 URL:
>             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"],
> {"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.

View raw message