mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'sharding' of https://github.com/triAGENS/ArangoDB into sharding
This commit is contained in:
commit
74c76ce41e
|
@ -312,8 +312,8 @@ function handleDatabaseChanges (plan, current) {
|
|||
function createLocalCollections (plannedCollections) {
|
||||
var ourselves = ArangoServerState.id();
|
||||
|
||||
var createCollectionAgency = function (database, payload) {
|
||||
ArangoAgency.set("Current/Collections/" + database + "/" + payload.id + "/" + ourselves,
|
||||
var createCollectionAgency = function (database, shard, payload) {
|
||||
ArangoAgency.set("Current/Collections/" + database + "/" + payload.id + "/" + shard,
|
||||
payload);
|
||||
};
|
||||
|
||||
|
@ -377,7 +377,7 @@ function createLocalCollections (plannedCollections) {
|
|||
|
||||
writeLocked({ part: "Current" },
|
||||
createCollectionAgency,
|
||||
[ database, payload ]);
|
||||
[ database, shard, payload ]);
|
||||
}
|
||||
else {
|
||||
// collection exists, now compare collection properties
|
||||
|
@ -411,7 +411,7 @@ function createLocalCollections (plannedCollections) {
|
|||
|
||||
writeLocked({ part: "Current" },
|
||||
createCollectionAgency,
|
||||
[ database, payload ]);
|
||||
[ database, shard, payload ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -438,9 +438,9 @@ function createLocalCollections (plannedCollections) {
|
|||
function dropLocalCollections (plannedCollections) {
|
||||
var ourselves = ArangoServerState.id();
|
||||
|
||||
var dropCollectionAgency = function (database, id) {
|
||||
var dropCollectionAgency = function (database, shardID, id) {
|
||||
try {
|
||||
ArangoAgency.remove("Current/Collections/" + database + "/" + id + "/" + ourselves);
|
||||
ArangoAgency.remove("Current/Collections/" + database + "/" + id + "/" + shardID);
|
||||
}
|
||||
catch (err) {
|
||||
// ignore errors
|
||||
|
@ -487,7 +487,7 @@ function dropLocalCollections (plannedCollections) {
|
|||
|
||||
writeLocked({ part: "Current" },
|
||||
dropCollectionAgency,
|
||||
[ database, collections[collection].planId ]);
|
||||
[ database, collection, collections[collection].planId ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue