From 7dec299c3a0fc14b3e275120b0fdba690cd9fbd9 Mon Sep 17 00:00:00 2001 From: Max Neunhoeffer Date: Mon, 23 May 2016 20:40:48 +0200 Subject: [PATCH] Improve error messages. --- js/server/modules/@arangodb/cluster.js | 5 +++++ .../resilience/resilience-synchronous-repl-cluster.js | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/js/server/modules/@arangodb/cluster.js b/js/server/modules/@arangodb/cluster.js index 32bdc371a7..2fe1a95b9d 100644 --- a/js/server/modules/@arangodb/cluster.js +++ b/js/server/modules/@arangodb/cluster.js @@ -94,6 +94,9 @@ function startReadLockOnLeader (endpoint, database, collName, timeout) { } console.debug("startReadLockOnLeader: Do not see read lock yet..."); } + var asyncJobId = rr.headers["x-arango-async-id"]; + r = require({ url: url + "/_api/job/" + asyncJobId, body: "", method: "PUT"}); + console.error("startReadLockOnLeader: giving up, async result:", r); return false; } @@ -956,6 +959,8 @@ function synchronizeLocalFollowerCollections (plannedCollections, ok = false; } } + } else { + console.error("lockJobId was false"); } if (ok) { console.info("Synchronization worked for shard", shard); diff --git a/js/server/tests/resilience/resilience-synchronous-repl-cluster.js b/js/server/tests/resilience/resilience-synchronous-repl-cluster.js index bed0640371..af8493089d 100644 --- a/js/server/tests/resilience/resilience-synchronous-repl-cluster.js +++ b/js/server/tests/resilience/resilience-synchronous-repl-cluster.js @@ -34,7 +34,6 @@ const arangodb = require("@arangodb"); const db = arangodb.db; const ERRORS = arangodb.errors; const _ = require("lodash"); -const print = require("internal").print; const wait = require("internal").wait; const suspendExternal = require("internal").suspendExternal; const continueExternal = require("internal").continueExternal; @@ -67,6 +66,7 @@ function SynchronousReplicationSuite () { //////////////////////////////////////////////////////////////////////////////// function waitForSynchronousReplication(database) { + console.info("Waiting for synchronous replication to settle..."); cinfo = global.ArangoClusterInfo.getCollectionInfo(database, cn); shards = Object.keys(cinfo.shards); var count = 0; @@ -76,7 +76,7 @@ function SynchronousReplicationSuite () { ); let replicas = ccinfo.map(s => s.servers.length); if (_.all(replicas, x => x === 2)) { - print("Replication up and running!"); + console.info("Replication up and running!"); return true; } wait(0.5); @@ -280,15 +280,11 @@ function SynchronousReplicationSuite () { //////////////////////////////////////////////////////////////////////////////// setUp : function () { - console.error("Dumdidum"); var systemCollServers = findCollectionServers("_system", "_graphs"); - console.error("Dumdidum"); while (true) { - console.error("Dumdidei"); db._drop(cn); c = db._create(cn, {numberOfShards: 1, replicationFactor: 2}); var servers = findCollectionServers("_system", cn); - console.error("Dideldum:", systemCollServers, servers, _.intersection(systemCollServers, servers)); if (_.intersection(systemCollServers, servers).length === 0) { return; }