From f621fe6076ad99b9e3173e4ab8c302e42e5a7f30 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 18 Mar 2019 20:56:50 +0100 Subject: [PATCH] revert a previous change that caused existing system collections on a slave to be truncated instead of being deleted (#8443) truncating instead of deleting introduced the possibility of the collection's indexes continuing to exist with different ids on the slave than on the master, leading to potential follow-up problems --- arangod/Replication/DatabaseInitialSyncer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arangod/Replication/DatabaseInitialSyncer.cpp b/arangod/Replication/DatabaseInitialSyncer.cpp index b121156d6b..79e4da147e 100644 --- a/arangod/Replication/DatabaseInitialSyncer.cpp +++ b/arangod/Replication/DatabaseInitialSyncer.cpp @@ -1128,9 +1128,10 @@ Result DatabaseInitialSyncer::handleCollection(VPackSlice const& parameters, if (col != nullptr) { bool truncate = false; - if (col->system()) { - // better not throw away system collections. otherwise they may be dropped - // and this can be a problem if the server crashes before they are recreated. + if (col->name() == TRI_COL_NAME_USERS) { + // better not throw away the _users collection. otherwise it is gone + // and this may be a problem if the + // server crashes in-between. truncate = true; }