diff --git a/arangod/Agency/Store.cpp b/arangod/Agency/Store.cpp index 7ebc2c62f2..fab46e5803 100644 --- a/arangod/Agency/Store.cpp +++ b/arangod/Agency/Store.cpp @@ -233,6 +233,8 @@ std::vector Store::apply ( // Check precondition bool Store::check (VPackSlice const& slice) const { + LOG(WARN) << slice.toJson(); + if (!slice.isObject()) { // Must be object LOG_TOPIC(WARN, Logger::AGENCY) << "Cannot check precondition: " << slice.toJson(); @@ -240,6 +242,7 @@ bool Store::check (VPackSlice const& slice) const { } for (auto const& precond : VPackObjectIterator(slice)) { // Preconditions + LOG(WARN) << precond.value.toJson(); std::string path = precond.key.copyString(); bool found = false; Node node ("precond"); @@ -251,6 +254,7 @@ bool Store::check (VPackSlice const& slice) const { if (precond.value.isObject()) { for (auto const& op : VPackObjectIterator(precond.value)) { + LOG(WARN) << node.slice().toJson() << " " << op.key.copyString() << ":" << op.value.toJson(); std::string const& oper = op.key.copyString(); if (oper == "old") { // old if (node != op.value) { @@ -273,13 +277,16 @@ bool Store::check (VPackSlice const& slice) const { << "Non boolsh expression for 'oldEmpty' precondition"; return false; } + LOG(WARN) << found; if (op.value.getBool() ? found : !found) { return false; } } } } else { - return node == precond.value; + if (node != precond.value) { + return false; + } } } diff --git a/js/client/modules/@arangodb/testing.js b/js/client/modules/@arangodb/testing.js index b1cabce05b..6b13fb46a8 100644 --- a/js/client/modules/@arangodb/testing.js +++ b/js/client/modules/@arangodb/testing.js @@ -1385,7 +1385,7 @@ function startInstanceAgency(instanceInfo, protocol, options, const N = options.agencySize; if (options.agencyWaitForSync === undefined) { - options.agencyWaitForSync = true; + options.agencyWaitForSync = false; } const wfs = options.agencyWaitForSync; diff --git a/js/client/tests/agency/agency-test.js b/js/client/tests/agency/agency-test.js index a2335757ce..31d1901789 100644 --- a/js/client/tests/agency/agency-test.js +++ b/js/client/tests/agency/agency-test.js @@ -158,14 +158,32 @@ function agencyTestSuite () { res = writeAgency([[{"/a/b/c":{"op":"set","new":14}},{"/a":{"old":{"b":{"c":13}}}}]]); assertEqual(res.statusCode, 200); // multiple preconditions - res = writeAgency([[{"/a":12},{"/a":{"oldEmpty":false}}]]); - assertEqual(readAndCheck([["/a"]]), [{a:12}]); - res = writeAgency([[{"/a":13},{"/a":{"oldEmpty":false},"/a":{"oldEmpty":true}}]]); + res = writeAgency([[{"/a":1,"/b":true,"/c":"c"},{"/a":{"oldEmpty":false}}]]); + assertEqual(readAndCheck([["/a","/b","c"]]), [{a:1,b:true,c:"c"}]); + res = writeAgency([[{"/a":2},{"/a":{"oldEmpty":false},"/b":{"oldEmpty":true}}]]); assertEqual(res.statusCode, 412); - assertEqual(readAndCheck([["/a"]]), [{a:12}]); - res = writeAgency([[{"/a":13},{"/a":{"oldEmpty":true},"/a":{"oldEmpty":false}}]]); + assertEqual(readAndCheck([["/a"]]), [{a:1}]); + res = writeAgency([[{"/a":2},{"/a":{"oldEmpty":true},"/b":{"oldEmpty":false}}]]); assertEqual(res.statusCode, 412); - assertEqual(readAndCheck([["/a"]]), [{a:12}]); + assertEqual(readAndCheck([["/a"]]), [{a:1}]); + res = writeAgency([[{"/a":2},{"/a":{"oldEmpty":false},"/b":{"oldEmpty":false},"/c":{"oldEmpty":true}}]]); + assertEqual(res.statusCode, 412); + assertEqual(readAndCheck([["/a"]]), [{a:1}]); + res = writeAgency([[{"/a":2},{"/a":{"oldEmpty":false},"/b":{"oldEmpty":false},"/c":{"oldEmpty":false}}]]); + assertEqual(res.statusCode, 200); + assertEqual(readAndCheck([["/a"]]), [{a:2}]); + res = writeAgency([[{"/a":3},{"/a":{"old":2},"/b":{"oldEmpty":false},"/c":{"oldEmpty":false}}]]); + assertEqual(res.statusCode, 200); + assertEqual(readAndCheck([["/a"]]), [{a:3}]); + res = writeAgency([[{"/a":2},{"/a":{"old":2},"/b":{"oldEmpty":false},"/c":{"oldEmpty":false}}]]); + assertEqual(res.statusCode, 412); + assertEqual(readAndCheck([["/a"]]), [{a:3}]); + res = writeAgency([[{"/a":2},{"/a":{"old":3},"/b":{"oldEmpty":false},"/c":{"isArray":true}}]]); + assertEqual(res.statusCode, 412); + assertEqual(readAndCheck([["/a"]]), [{a:3}]); + res = writeAgency([[{"/a":2},{"/a":{"old":3},"/b":{"oldEmpty":false},"/c":{"isArray":false}}]]); + assertEqual(res.statusCode, 200); + assertEqual(readAndCheck([["/a"]]), [{a:2}]); }, diff --git a/lib/Basics/crc1.s b/lib/Basics/crc1.s index f3761680ca..2857027dd7 100644 --- a/lib/Basics/crc1.s +++ b/lib/Basics/crc1.s @@ -32,8 +32,8 @@ .globl TRI_BlockCrc32_SSE42 .globl _TRI_BlockCrc32_SSE42 #ifndef __APPLE__ - .type TRI_BlockCrc32_SSE42, @function - .type _TRI_BlockCrc32_SSE42, @function +// .type TRI_BlockCrc32_SSE42, @function +// .type _TRI_BlockCrc32_SSE42, @function #endif TRI_BlockCrc32_SSE42: _TRI_BlockCrc32_SSE42: @@ -58,7 +58,7 @@ crca9: ret #ifndef __APPLE__ - .size TRI_BlockCrc32_SSE42, .-TRI_BlockCrc32_SSE42 - .size _TRI_BlockCrc32_SSE42, .-_TRI_BlockCrc32_SSE42 +// .size TRI_BlockCrc32_SSE42, .-TRI_BlockCrc32_SSE42 +// .size _TRI_BlockCrc32_SSE42, .-_TRI_BlockCrc32_SSE42 #endif /* end of TRI_BlockCrc32_SSE42 */