[
https://issues.apache.org/jira/browse/COUCHDB-1391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194289#comment-13194289
]
Randall Leeds commented on COUCHDB-1391:
----------------------------------------
Can you explain couch_db.erl:705? Why did the list brackets appear around the
doc? I'm guessing that's the format new_revs wants.
For couch_db:open_doc_int/3 I would remove the first function clause entirely
and then add a clause to get_doc_infos/2. That cleanly splits the logic at the
choice of btree and introduces less redundant code for us to mess up down the
line.
In couch_db_updater:init_db/6 the line "Db1#db{security_ptr=local};" is
redundant in the clause where security_ptr is already the atom local.
Am I right that at these lines update a db as soon as it's opened? I was
wondering why I didn't see more backwards-compatibility code anywhere. Just
want to know I've got it right.
couch_db_updater:init_security/2 needs to be fixed to keep the user context
intact, I think. Right now it sets the user context to _admin so it can update
the security document but then returns that modified #db record back to init_db
without dropping those privileges. Unless I misunderstand, that seems wrong.
Any reason why copy_docs can't be changed to take a btree argument? It looks
mostly the same as copy_local_docs.
What's the change in couch_replicator? The second clause doesn't make total
sense to me. Is that to reset the leading number for the rev when the log is
migrated to a new ID?
Otherwise, nicely done! Looks great! Thanks.
> Implement _security as _local doc with revision trees
> -----------------------------------------------------
>
> Key: COUCHDB-1391
> URL: https://issues.apache.org/jira/browse/COUCHDB-1391
> Project: CouchDB
> Issue Type: Improvement
> Components: Database Core
> Reporter: Paul Joseph Davis
> Attachments: 0001-Refactor-revision-merging.patch,
> 0002-Replace-_local-doc-sequence-with-revision-trees.patch,
> 0003-Prevent-multiple-updates-to-a-single-_local-doc.patch,
> 0004-Implement-_security-as-a-_local-doc.patch
>
>
> We had a discussion [1] a while back about updating the _security object so
> that it could be replicated (internally) in a cluster or similar environment.
> The basic gist was "update _local docs to have a revision tree, update
> _security to be a _local doc with docid "_local/_security" and keep the
> current _security API for a version or two for backwards compatibility (or
> forever, what color is your bike shed?)"
> So I did that.
> Basic patch progression is:
> 1. Refactor revision merging logic so that we can split it out of
> couch_db_updater's code path for updating normal docs.
> 2. Implement _local docs with #full_doc_info{} records (and thus revision
> trees)
> 3. Implement _security as _local/_security
> These things are done. Tests should theoretically pass after each patch but I
> haven't gone back and tried. They definitely pass (minus auth_cache which I
> just submitted a fix for) now except for replication.js appears to fail for
> random reasons. I can't quite decide if I've introduced this or if it just
> fails randomly. Rather than run it a lot more times and continue to be
> confused I'm starting this ticket so I can have other people test and tell me
> their results.
> Also, the test suite is rather wonky on trunk with segfaults. We should
> really look into that more.
> Patches forth coming. I've also pushed the branch to [2].
> [1]
> http://grokbase.com/t/couchdb.apache.org/dev/2011/08/the-security-object-should-be-versioned/17rfmmtlu3lagqvgyq7cay26dqk4
> [2]
> http://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=log;h=refs/heads/new-security-object
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira