From 18436b6b277409c38f9a21169649bd2d023056a2 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Tue, 21 Jan 2014 09:56:54 +0100 Subject: [PATCH 1/2] Fix reporting of new collection in Current (shardID instead of DBserverID) --- js/server/modules/org/arangodb/cluster.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/server/modules/org/arangodb/cluster.js b/js/server/modules/org/arangodb/cluster.js index d12653d093..1f8c22c687 100644 --- a/js/server/modules/org/arangodb/cluster.js +++ b/js/server/modules/org/arangodb/cluster.js @@ -271,8 +271,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); }; @@ -336,7 +336,7 @@ function createLocalCollections (plannedCollections) { writeLocked({ part: "Current" }, createCollectionAgency, - [ database, payload ]); + [ database, shard, payload ]); } else { // collection exists, now compare collection properties @@ -370,7 +370,7 @@ function createLocalCollections (plannedCollections) { writeLocked({ part: "Current" }, createCollectionAgency, - [ database, payload ]); + [ database, shard, payload ]); } } } From 06953daf809f1eb0f3723c2d85e2424e17453882 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Tue, 21 Jan 2014 10:44:02 +0100 Subject: [PATCH 2/2] Fix reporting of dropped shard in Current. --- js/server/modules/org/arangodb/cluster.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/server/modules/org/arangodb/cluster.js b/js/server/modules/org/arangodb/cluster.js index 1f8c22c687..b8ad03dc25 100644 --- a/js/server/modules/org/arangodb/cluster.js +++ b/js/server/modules/org/arangodb/cluster.js @@ -397,9 +397,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 @@ -446,7 +446,7 @@ function dropLocalCollections (plannedCollections) { writeLocked({ part: "Current" }, dropCollectionAgency, - [ database, collections[collection].planId ]); + [ database, collection, collections[collection].planId ]); } } }