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) {
|
function createLocalCollections (plannedCollections) {
|
||||||
var ourselves = ArangoServerState.id();
|
var ourselves = ArangoServerState.id();
|
||||||
|
|
||||||
var createCollectionAgency = function (database, payload) {
|
var createCollectionAgency = function (database, shard, payload) {
|
||||||
ArangoAgency.set("Current/Collections/" + database + "/" + payload.id + "/" + ourselves,
|
ArangoAgency.set("Current/Collections/" + database + "/" + payload.id + "/" + shard,
|
||||||
payload);
|
payload);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ function createLocalCollections (plannedCollections) {
|
||||||
|
|
||||||
writeLocked({ part: "Current" },
|
writeLocked({ part: "Current" },
|
||||||
createCollectionAgency,
|
createCollectionAgency,
|
||||||
[ database, payload ]);
|
[ database, shard, payload ]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// collection exists, now compare collection properties
|
// collection exists, now compare collection properties
|
||||||
|
@ -411,7 +411,7 @@ function createLocalCollections (plannedCollections) {
|
||||||
|
|
||||||
writeLocked({ part: "Current" },
|
writeLocked({ part: "Current" },
|
||||||
createCollectionAgency,
|
createCollectionAgency,
|
||||||
[ database, payload ]);
|
[ database, shard, payload ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -438,9 +438,9 @@ function createLocalCollections (plannedCollections) {
|
||||||
function dropLocalCollections (plannedCollections) {
|
function dropLocalCollections (plannedCollections) {
|
||||||
var ourselves = ArangoServerState.id();
|
var ourselves = ArangoServerState.id();
|
||||||
|
|
||||||
var dropCollectionAgency = function (database, id) {
|
var dropCollectionAgency = function (database, shardID, id) {
|
||||||
try {
|
try {
|
||||||
ArangoAgency.remove("Current/Collections/" + database + "/" + id + "/" + ourselves);
|
ArangoAgency.remove("Current/Collections/" + database + "/" + id + "/" + shardID);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
// ignore errors
|
// ignore errors
|
||||||
|
@ -487,7 +487,7 @@ function dropLocalCollections (plannedCollections) {
|
||||||
|
|
||||||
writeLocked({ part: "Current" },
|
writeLocked({ part: "Current" },
|
||||||
dropCollectionAgency,
|
dropCollectionAgency,
|
||||||
[ database, collections[collection].planId ]);
|
[ database, collection, collections[collection].planId ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue