Details
-
Improvement
-
Resolution: Fixed
-
Major
-
2.6.1
-
Security Level: Public
-
None
-
CBG Sprint 38, CBG Sprint 39
-
3
Description
Currently it's possible to define a Sync Gateway config where you have multiple databases connected to the same backend bucket, e.g.:
{
|
"logging": {
|
"console": {
|
"log_keys": ["*"]
|
}
|
},
|
"databases": {
|
"db": {
|
"server": "couchbase://localhost",
|
"username": "Administrator",
|
"password": "password",
|
"bucket": "default",
|
"users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } },
|
"allow_conflicts": false,
|
"revs_limit": 20,
|
"num_index_replicas": 0
|
},
|
"db2": {
|
"server": "couchbase://localhost",
|
"username": "Administrator",
|
"password": "password",
|
"bucket": "default",
|
"users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } },
|
"allow_conflicts": false,
|
"revs_limit": 20,
|
"num_index_replicas": 0
|
}
|
}
|
}
|
This is a bad idea as (as far as I know) this is untested and is likely to cause issues with overlapping DCP streams.
Additionally, you could end up in a situation where both databases have different Sync Functions, which could then cause real havoc, particularly if they are both trying to import.
Would be good to try and avoid this behavior if possible by refusing to start if this situation is detected (maybe have to compare bucket UUIDs?).