Re: The replicator needs a superuser mode

2011-08-25 Thread Chris Anderson
I see nothing wrong with an admin capability that allows you to break the rules if it is more convenient for common operations. This is not really a replicator thing, what we're talking about is giving the _admin power to invoke skip_validations=true on document updates. This can be useful for bulk

Re: The replicator needs a superuser mode

2011-08-17 Thread Amos Hayes
We've strayed onto the topic of backup/restore/import/export and someone mentioned pg_dump, so I'll toss this out there. As a long time user of PostgreSQL and their import/export tools, I'd definitely suggest having a look at what options have evolved in their tool too get a feel for what peop

Re: The replicator needs a superuser mode

2011-08-17 Thread Adam Kocoloski
On Aug 17, 2011, at 11:46 AM, Jean-Pierre Fiset wrote: > I think that the operations of replication and backing up are quite > different. Although some are using the replication features for backing up, I > tend to think of replication as an operation taking place between two nodes > that do no

Re: The replicator needs a superuser mode

2011-08-17 Thread Jean-Pierre Fiset
I think that the operations of replication and backing up are quite different. Although some are using the replication features for backing up, I tend to think of replication as an operation taking place between two nodes that do not necessarily trust one another. If what you are proposing is a

Re: The replicator needs a superuser mode

2011-08-17 Thread Jason Smith
On Wed, Aug 17, 2011 at 9:11 PM, Noah Slater wrote: > > On 17 Aug 2011, at 11:06, Benoit Chesneau wrote: > >> Philosophy apart, dump and restore could be indeed useful to bootstrap >> db, make plain backup/restore strategies, exchange dbs over a disk/mem >> card without any couch installed etc. >

Re: The replicator needs a superuser mode

2011-08-17 Thread Noah Slater
On 17 Aug 2011, at 11:06, Benoit Chesneau wrote: > Philosophy apart, dump and restore could be indeed useful to bootstrap > db, make plain backup/restore strategies, exchange dbs over a disk/mem > card without any couch installed etc. Yep, but in my mind this should live outside CouchDB's HTTP A

Re: The replicator needs a superuser mode

2011-08-17 Thread Adam Kocoloski
On Aug 16, 2011, at 11:37 PM, Jason Smith wrote: > 2. Replication is a whole worldview, adding ?force=true breaks that worldview Replication is not a worldview, it's a mechanism by which documents are transferred between databases. I think that's the crux of our disagreement. Cheers, Adam

Re: The replicator needs a superuser mode

2011-08-17 Thread Benoit Chesneau
On Wed, Aug 17, 2011 at 5:37 AM, Jason Smith wrote: > tl;dr response here, philosophical musings below. > > 1. The requirements are real, it's reasonable to want to copy from A to B > 2. Replication is a whole worldview, adding ?force=true breaks that worldview > 3. Dump and restore sounds more ap

Re: The replicator needs a superuser mode

2011-08-16 Thread Randall Leeds
On Tue, Aug 16, 2011 at 20:37, Jason Smith wrote: > The nice thing about _dump and _restore, and also rsync, is that you > make full, opaque clones (not replicas!). You can't merge or splice > data sets. Once you are talking about merging data, or pulling out a > subset, now you are in database l

Re: The replicator needs a superuser mode

2011-08-16 Thread Jason Smith
tl;dr response here, philosophical musings below. 1. The requirements are real, it's reasonable to want to copy from A to B 2. Replication is a whole worldview, adding ?force=true breaks that worldview 3. Dump and restore sounds more appropriate On Wed, Aug 17, 2011 at 9:34 AM, Adam Kocoloski wr

Re: The replicator needs a superuser mode

2011-08-16 Thread Jason Smith
On Wed, Aug 17, 2011 at 9:49 AM, Adam Kocoloski wrote: > On Aug 16, 2011, at 10:31 PM, Jason Smith wrote: > >> On Tue, Aug 16, 2011 at 9:26 PM, Adam Kocoloski wrote: >>> One of the principal uses of the replicator is to "make this database look >>> like that one".  We're unable to do that in the

Re: The replicator needs a superuser mode

2011-08-16 Thread Adam Kocoloski
On Aug 16, 2011, at 10:31 PM, Jason Smith wrote: > On Tue, Aug 16, 2011 at 9:26 PM, Adam Kocoloski wrote: >> One of the principal uses of the replicator is to "make this database look >> like that one". We're unable to do that in the general case today because >> of the combination of validati

Re: The replicator needs a superuser mode

2011-08-16 Thread Adam Kocoloski
On Aug 16, 2011, at 10:23 PM, Jason Smith wrote: > On Wed, Aug 17, 2011 at 7:03 AM, Adam Kocoloski wrote: >> On Aug 16, 2011, at 5:46 PM, Randall Leeds wrote: >> >>> -1 on _skip_validation and new role >>> >>> One can always write a validation document that considers the role, no? Why >>> can't

Re: The replicator needs a superuser mode

2011-08-16 Thread Jason Smith
On Tue, Aug 16, 2011 at 9:26 PM, Adam Kocoloski wrote: > One of the principal uses of the replicator is to "make this database look > like that one".  We're unable to do that in the general case today because of > the combination of validation functions and out-of-order document transfers.   > I

Re: The replicator needs a superuser mode

2011-08-16 Thread Jason Smith
On Wed, Aug 17, 2011 at 7:03 AM, Adam Kocoloski wrote: > On Aug 16, 2011, at 5:46 PM, Randall Leeds wrote: > >> -1 on _skip_validation and new role >> >> One can always write a validation document that considers the role, no? Why >> can't users who need this functionality craft a validation functi

Re: The replicator needs a superuser mode

2011-08-16 Thread Dale Harvey
On 17 August 2011 02:47, Adam Kocoloski wrote: > On Aug 16, 2011, at 8:20 PM, Randall Leeds wrote: > > > On Tue, Aug 16, 2011 at 17:03, Adam Kocoloski > wrote: > > > >> On Aug 16, 2011, at 5:46 PM, Randall Leeds wrote: > >> > >>> -1 on _skip_validation and new role > >>> > >>> One can always wri

Re: The replicator needs a superuser mode

2011-08-16 Thread Adam Kocoloski
On Aug 16, 2011, at 8:20 PM, Randall Leeds wrote: > On Tue, Aug 16, 2011 at 17:03, Adam Kocoloski wrote: > >> On Aug 16, 2011, at 5:46 PM, Randall Leeds wrote: >> >>> -1 on _skip_validation and new role >>> >>> One can always write a validation document that considers the role, no? >> Why >>>

Re: The replicator needs a superuser mode

2011-08-16 Thread Jason Smith
On Tue, Aug 16, 2011 at 10:24 PM, Jan Lehnardt wrote: > This is only slightly related, but I'm dreaming of /db/_dump and /db/_restore > endpoints Jan, I also had that dream at CouchOne, but now I think it is a very bad idea. A database is a URL. Every URL is different. Cloning URL_A to URL_B is

Re: The replicator needs a superuser mode

2011-08-16 Thread Randall Leeds
On Tue, Aug 16, 2011 at 17:03, Adam Kocoloski wrote: > On Aug 16, 2011, at 5:46 PM, Randall Leeds wrote: > > > -1 on _skip_validation and new role > > > > One can always write a validation document that considers the role, no? > Why > > can't users who need this functionality craft a validation f

Re: The replicator needs a superuser mode

2011-08-16 Thread Adam Kocoloski
On Aug 16, 2011, at 5:46 PM, Randall Leeds wrote: > -1 on _skip_validation and new role > > One can always write a validation document that considers the role, no? Why > can't users who need this functionality craft a validation function for this > purpose? This sounds like a blog post and not a

Re: The replicator needs a superuser mode

2011-08-16 Thread Randall Leeds
On Tue, Aug 16, 2011 at 16:23, Paul Davis wrote: > On Tue, Aug 16, 2011 at 4:46 PM, Randall Leeds > wrote: > > -1 on _skip_validation and new role > > > > One can always write a validation document that considers the role, no? > Why > > can't users who need this functionality craft a validation f

Re: The replicator needs a superuser mode

2011-08-16 Thread Paul Davis
On Tue, Aug 16, 2011 at 4:46 PM, Randall Leeds wrote: > -1 on _skip_validation and new role > > One can always write a validation document that considers the role, no? Why > can't users who need this functionality craft a validation function for this > purpose? This sounds like a blog post and not

Re: The replicator needs a superuser mode

2011-08-16 Thread Randall Leeds
-1 on _skip_validation and new role One can always write a validation document that considers the role, no? Why can't users who need this functionality craft a validation function for this purpose? This sounds like a blog post and not a database feature. +0 on _dump/_load If it ships raw .couch

Re: The replicator needs a superuser mode

2011-08-16 Thread Adam Kocoloski
Hi Jean-Pierre, I'm not quite sure I follow that line of reasoning. A user with _admin privileges on the database can easily remove any validation functions prior to writing today. In my proposal skipping validation would require _admin rights and an explicit opt-in on a per-request basis. Wh

Re: The replicator needs a superuser mode

2011-08-16 Thread Paul Davis
On Tue, Aug 16, 2011 at 1:10 PM, Adam Kocoloski wrote: > Wow, this thread got hijacked a bit :) You must be new here.

Re: The replicator needs a superuser mode

2011-08-16 Thread Jean-Pierre Fiset
I understand the issue brought by Adam since in our CouchDb application, there is a need to have a replicator role and the validation functions skip most of the tests if the role is set for the current user. On the other hand, at the current time, I am not in favour of making super users for th

Re: The replicator needs a superuser mode

2011-08-16 Thread Adam Kocoloski
Hmm, if we used a separate role we'd need a multi-step process to trigger the replication 1) create the database 2) have an admin grant the _skip_validation role on that DB to the replicator's user_ctx 3) trigger the replication Kind of annoying. Certainly would be simpler to allow _admins to

Re: The replicator needs a superuser mode

2011-08-16 Thread Robert Newson
no objection to special role. As in my opening statement, would be concerned about adding it to _admin without devoting more thought to possible unintended consequences. b. On 16 August 2011 19:13, Robert Dionne wrote: > No objection, just the question of why the need for a new role, why not use

Re: The replicator needs a superuser mode

2011-08-16 Thread Robert Dionne
No objection, just the question of why the need for a new role, why not use admin? On Aug 16, 2011, at 2:10 PM, Adam Kocoloski wrote: > Wow, this thread got hijacked a bit :) Anyone object to the special role > that has the "skip validation" superpower? > > Adam > > On Aug 16, 2011, at 1:5

Re: The replicator needs a superuser mode

2011-08-16 Thread Adam Kocoloski
Wow, this thread got hijacked a bit :) Anyone object to the special role that has the "skip validation" superpower? Adam On Aug 16, 2011, at 1:51 PM, Jan Lehnardt wrote: > Both rsync an scp won't allow me to do curl http://couch/db/_dump | curl > http://couch/db/_restore. > > I acknowledge t

Re: The replicator needs a superuser mode

2011-08-16 Thread Jan Lehnardt
Both rsync an scp won't allow me to do curl http://couch/db/_dump | curl http://couch/db/_restore. I acknowledge that similar solutions exist, but using the http transport allows for more fun things down the road. See what we are doing with _changes today where DbUpdateNotifications nearly do

Re: The replicator needs a superuser mode

2011-08-16 Thread Nathan Vander Wilt
We've already got replication, _all_docs and some really robust on-disk consistency properties. For shuttling raw database files between servers, wouldn't rsync be more efficient (and fit better within existing sysadmin security/deployment structures)? -nvw On Aug 16, 2011, at 9:55 AM, Paul Da

Re: The replicator needs a superuser mode

2011-08-16 Thread Paul Davis
Me and Adam were just mulling over a similar endpoint the other night that could be used to generate plain-text backups similar to what couchdb-dump and couchdb-load were doing. With the idea that there would be some special sauce to pipe from one _dump endpoint directly into a different _load hand

Re: The replicator needs a superuser mode

2011-08-16 Thread Ryan Ramage
> This is only slightly related, but I'm dreaming of /db/_dump and /db/_restore > endpoints (the names don't matter, could be one with GET / PUT) that just > ships verbatim .couch files over HTTP. It would be for admins only, it would > not be incremental (although we might be able to add that),

Re: The replicator needs a superuser mode

2011-08-16 Thread Jan Lehnardt
This is only slightly related, but I'm dreaming of /db/_dump and /db/_restore endpoints (the names don't matter, could be one with GET / PUT) that just ships verbatim .couch files over HTTP. It would be for admins only, it would not be incremental (although we might be able to add that), and I h

Re: The replicator needs a superuser mode

2011-08-16 Thread Robert Newson
+1 on the intention but we'll need to be careful. The use case is specifically to allow verbatim migration of databases between servers. A separate role makes sense as I'm not sure of the consequences of explicitly granting this ability to the existing _admin role. B. On 16 August 2011 15:26, Ada

The replicator needs a superuser mode

2011-08-16 Thread Adam Kocoloski
One of the principal uses of the replicator is to "make this database look like that one". We're unable to do that in the general case today because of the combination of validation functions and out-of-order document transfers. It's entirely possible for a document to be saved in the source D