garden20 / garden-core

Small surface api to install, update and manage garden apps. Use in node, requirejs, and browser global.
0 stars 1 forks source link

call to _replicate does not assure an update #4

Open mandric opened 10 years ago

mandric commented 10 years ago

Depending on revisions of the database, the ddoc may or may not get updated. So garden-core command will return "update succeeded" yet the ddoc was not actually updated, it only confirms the _replicate command returned 200. This can particularly be an issue if you are switching between markets or update an ddoc manually via HTTP. The ddoc _rev property and replication algorithms need to be in sync between markets for a _replicate call to actually change something. I'm starting to think replication is not what we want to use to install apps/ddocs. We want to do a brute force install by taking a ddoc from a market or one location and then overwriting another ddoc (use existing _rev) in a new location, not a conventional replication? @ryanramage @garethbowen @browndav thoughts?

It would also be nice to have an option to upload a ddoc.json file so an update or install can happen without dashboard even having an internet connection.

mandric commented 10 years ago

Example payload used for _replicate:

{
  "source":"http://staging.dev.medicmobile.org/market_1/_db",
  "target":"kujua-lite",
  "create_target":true,
  "doc_ids":["kujua-lite"]
}
garethbowen commented 10 years ago

Yeah I think a brute force approach is good. The only downside is a larger download, but it's an infrequent action so this isn't a big issue.

mandric commented 10 years ago

@ryanramage What do you think about making the memory transfer method the default update/install method and replication the backup?

mandric commented 10 years ago

ping @ryanramage