@@ -45,12 +45,20 @@ When the _Leader_ goes down, this is automatically detected by the _Agency_
45
45
instance, which is also started in this mode. This instance will make the
46
46
previous follower stop its replication and make it the new _ Leader_ .
47
47
48
- The _ Follower_ will deny all read and write requests from client applications.
48
+ Operative Behaviour
49
+ -------------------
50
+
51
+ In contrast to the normal behaviour of a single-server instance, the Active-Failover
52
+ mode will change the behaviour of ArangoDB in some situations.
53
+
54
+ The _ Follower_ will _ always_ deny write requests from client applications. Starting from ArangoDB 3.4
55
+ read requests are _ only_ permitted if the requests is marked with the ` X-Arango-Allow-Dirty-Read ` header,
56
+ otherwise they are denied too.
49
57
Only the replication itself is allowed to access the follower's data until the
50
58
follower becomes a new _ Leader_ (should a _ failover_ happen).
51
59
52
60
When sending a request to read or write data on a _ Follower_ , the _ Follower_ will
53
- always respond with ` HTTP 503 (Service unavailable) ` and provide the address of
61
+ respond with ` HTTP 503 (Service unavailable) ` and provide the address of
54
62
the current _ Leader_ . Client applications and drivers can use this information to
55
63
then make a follow-up request to the proper _ Leader_ :
56
64
@@ -64,6 +72,18 @@ Client applications can also detect who the current _Leader_ and the _Followers_
64
72
are by calling the ` /_api/cluster/endpoints ` REST API. This API is accessible
65
73
on _ Leader_ and _ Followers_ alike.
66
74
75
+ Reading from Followers
76
+ ----------------------
77
+
78
+ Followers in the active-failover setup are in a read-only mode. It is possible to read from these
79
+ followers by adding a ` X-Arango-Allow-Dirty-Read ` header on each request. Responses will then automatically
80
+ contain the ` X-Arango-Potential-Dirty-Read ` header so that clients can reject accidental dirty reads.
81
+
82
+ Depending on the driver support for your specific programming language, you should be able to enable this option.
83
+
84
+ Tooling Support
85
+ ---------------
86
+
67
87
The tool _ ArangoDB Starter_ supports starting two servers with asynchronous
68
88
replication and failover [ out of the box] ( ../../../Deployment/ActiveFailover/UsingTheStarter.md ) .
69
89
0 commit comments