From 48dba7dd84a42fb164522134e941ea81d7efd5fe Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 18 Mar 2021 11:46:01 +0100 Subject: [PATCH] change feature order so that ServerIdFeature is before ReplicationFeature (#13743) --- CHANGELOG | 7 +++++++ arangod/Replication/ReplicationFeature.cpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c353bd2711e0..bdc8ceb6b407 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,13 @@ devel ----- +* Make ReplicationFeature formally depend on ServerIdFeature, because the + former relies on the server id being already loaded by the latter. + If this dependency is not established properly, it is undefined if the + ReplicationFeature starts earlier than the ServerIdFeature, which can lead + to the ReplicationFeature not sending its server id properly to the leader + when doing replication between two single servers. + * Fix potentially undefined behavior when creating a CalculationTransactionContext for an arangosearch analyzer. An uninitialized struct member was passed as an argument to its base class. This potentially had no observable effects, but diff --git a/arangod/Replication/ReplicationFeature.cpp b/arangod/Replication/ReplicationFeature.cpp index c151e689f8e2..b899d4eda0ea 100644 --- a/arangod/Replication/ReplicationFeature.cpp +++ b/arangod/Replication/ReplicationFeature.cpp @@ -39,6 +39,7 @@ #include "Rest/GeneralResponse.h" #include "RestServer/DatabaseFeature.h" #include "RestServer/MetricsFeature.h" +#include "RestServer/ServerIdFeature.h" #include "RestServer/SystemDatabaseFeature.h" #include "StorageEngine/StorageEngineFeature.h" #include "VocBase/vocbase.h" @@ -97,6 +98,7 @@ ReplicationFeature::ReplicationFeature(ApplicationServer& server) startsAfter(); startsAfter(); + startsAfter(); startsAfter(); startsAfter(); }