diff --git a/js/server/modules/org/arangodb/cluster.js b/js/server/modules/org/arangodb/cluster.js index 4dbd3ec1ef..9e2a681430 100644 --- a/js/server/modules/org/arangodb/cluster.js +++ b/js/server/modules/org/arangodb/cluster.js @@ -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 ]); } } }