8000 Merge branch 'devel' of https://github.com/arangodb/arangodb into boo… · arangodb/arangodb@2d9c23e · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d9c23e

Browse files
committed
Merge branch 'devel' of https://github.com/arangodb/arangodb into boost-168
* 'devel' of https://github.com/arangodb/arangodb: Add simple Future library (#6464) More known issues for ArangoSearch in 3.4 (#6567) cleanoutServer Bug Fix (#6537) Do not retry connect on canceled connections (#6559) fix undefined behavior in query cache result handling (#6544) fix dependencies of init-database feature/serverid feature fix possible illegal access (#6556) safety first: turn off sync/async mixing for HTTPS in general Doc - Fix Active-Failover limitations (#6353) silence a compile warning about potential string value truncation follow compiler's recommendation Resilience test failure points (#6539) Feature/optimize arangosearch block (#6550) Fix single shard restriction with binary and. (#6549) add rocksdb::PinnableSlice for some key lookups (#6530) Bug fix/fix ssl vst (#6547) Bug fix/fix stats on skip (#6531) forward-port range deletion fix from upstream RocksDB (#6535)
2 parents 8f59a7e + 912f109 commit 2d9c23e

File tree

94 files changed

+7252
-784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+7252
-784
lines changed

3rdParty/fuerte/src/HttpConnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void HttpConnection<ST>::tryConnect(unsigned retries) {
213213
return;
214214
}
215215
FUERTE_LOG_DEBUG << "connecting failed: " << ec.message() << "\n";
216-
if (retries > 0) {
216+
if (retries > 0 && ec != asio_ns::error::operation_aborted) {
217217
tryConnect(retries - 1);
218218
} else {
219219
shutdownConnection(ErrorCondition::CouldNotConnect);

3rdParty/fuerte/src/VstConnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void VstConnection<ST>::tryConnect(unsigned retries) {
134134
return;
135135
}
136136
FUERTE_LOG_DEBUG << "connecting failed: " << ec.message() << "\n";
137-
if (retries > 0) {
137+
if (retries > 0 && ec != asio_ns::error::operation_aborted) {
138138
tryConnect(retries - 1);
139139
} else {
140140
shutdownConnection(ErrorCondition::CouldNotConnect);

3rdParty/rocksdb/v5.16.X/db/compaction_job.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,6 @@ Status CompactionJob::Run() {
593593
thread.join();
594594
}
595595

596-
if (output_directory_) {
597-
output_directory_->Fsync();
598-
}
599-
600596
compaction_stats_.micros = env_->NowMicros() - start_micros;
601597
MeasureTime(stats_, COMPACTION_TIME, compaction_stats_.micros);
602598

@@ -611,6 +607,10 @@ Status CompactionJob::Run() {
611607
}
612608
}
613609

610+
if (status.ok() && output_directory_) {
611+
status = output_directory_->Fsync();
612+
}
613+
614614
if (status.ok()) {
615615
thread_pool.clear();
616616
std::vector<const FileMetaData*> files_meta;

3rdParty/rocksdb/v5.16.X/db/flush_job.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ Status FlushJob::WriteLevel0Table() {
371371
s.ToString().c_str(),
372372
meta_.marked_for_compaction ? " (needs compaction)" : "");
373373

374-
if (output_file_directory_ != nullptr) {
375-
output_file_directory_->Fsync();
374+
if (s.ok() && output_file_directory_ != nullptr) {
375+
s = output_file_directory_->Fsync();
376376
}
377377
TEST_SYNC_POINT("FlushJob::WriteLevel0Table");
378378
db_mutex_->Lock();

3rdParty/rocksdb/v5.16.X/db/range_del_aggregator.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ class CollapsedRangeDelMap : public RangeDelMap {
171171
const Comparator* ucmp_;
172172

173173
public:
174-
CollapsedRangeDelMap(const Comparator* ucmp) : ucmp_(ucmp) {
174+
CollapsedRangeDelMap(const Comparator* ucmp)
175+
: rep_(stl_wrappers::LessOfComparator(ucmp)),
176+
ucmp_(ucmp) {
175177
InvalidatePosition();
176178
}
177179

@@ -493,7 +495,8 @@ Status RangeDelAggregator::AddTombstones(
493495
tombstone.end_key_ = largest->user_key();
494496
}
495497
}
496-
GetRangeDelMap(tombstone.seq_).AddTombstone(std::move(tombstone));
498+
auto seq = tombstone.seq_;
499+
GetRangeDelMap(seq).AddTombstone(std::move(tombstone));
497500
input->Next();
498501
}
499502
if (!first_iter) {

3rdParty/rocksdb/v5.16.X/util/filename.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ Status SetCurrentFile(Env* env, const std::string& dbname,
370370
}
371371
if (s.ok()) {
372372
if (directory_to_fsync != nullptr) {
373-
directory_to_fsync->Fsync();
373+
s = directory_to_fsync->Fsync();
374374
}
375375
} else {
376376
env->DeleteFile(tmp);

3rdParty/rocksdb/v5.16.X/utilities/backupable/backupable_db.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -874,19 +874,19 @@ Status BackupEngineImpl::CreateNewBackupWithMetadata(
874874
GetAbsolutePath(GetPrivateFileRel(new_backup_id, false)),
875875
&backup_private_directory);
876876
if (backup_private_directory != nullptr) {
877-
backup_private_directory->Fsync();
877+
s = backup_private_directory->Fsync();
878878
}
879-
if (private_directory_ != nullptr) {
880-
private_directory_->Fsync();
879+
if (s.ok() && private_directory_ != nullptr) {
880+
s = private_directory_->Fsync();
881881
}
882-
if (meta_directory_ != nullptr) {
883-
meta_directory_->Fsync();
882+
if (s.ok() && meta_directory_ != nullptr) {
883+
s = meta_directory_->Fsync();
884884
}
885-
if (shared_directory_ != nullptr) {
886-
shared_directory_->Fsync();
885+
if (s.ok() && shared_directory_ != nullptr) {
886+
s = shared_directory_->Fsync();
887887
}
888-
if (backup_directory_ != nullptr) {
889-
backup_directory_->Fsync();
888+
if (s.ok() && backup_directory_ != nullptr) {
889+
s = backup_directory_->Fsync();
890890
}
891891
}
892892

3rdParty/rocksdb/v5.16.X/utilities/blob_db/blob_db_impl.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,11 @@ std::pair<bool, int64_t> BlobDBImpl::DeleteObsoleteFiles(bool aborted) {
17301730

17311731
// directory change. Fsync
17321732
if (file_deleted) {
1733-
dir_ent_->Fsync();
1733+
Status s = dir_ent_->Fsync();
1734+
if (!s.ok()) {
1735+
ROCKS_LOG_ERROR(db_options_.info_log, "Failed to sync dir %s: %s",
1736+
blob_dir_.c_str(), s.ToString().c_str());
1737+
}
17341738
}
17351739

17361740
// put files back into obsolete if for some reason, delete failed

Documentation/Books/Manual/Architecture/DeploymentModes/ActiveFailover/Architecture.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,20 @@ When the _Leader_ goes down, this is automatically detected by the _Agency_
4545
instance, which is also started in this mode. This instance will make the
4646
previous follower stop its replication and make it the new _Leader_.
4747

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.
4957
Only the replication itself is allowed to access the follower's data until the
5058
follower becomes a new _Leader_ (should a _failover_ happen).
5159

5260
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
5462
the current _Leader_. Client applications and drivers can use this information to
5563
then make a follow-up request to the proper _Leader_:
5664

@@ -64,6 +72,18 @@ Client applications can also detect who the current _Leader_ and the _Followers_
6472
are by calling the `/_api/cluster/endpoints` REST API. This API is accessible
6573
on _Leader_ and _Followers_ alike.
6674

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+
6787
The tool _ArangoDB Starter_ supports starting two servers with asynchronous
6888
replication and failover [out of the box](../../../Deployment/ActiveFailover/UsingTheStarter.md).
6989

Documentation/Books/Manual/Architecture/DeploymentModes/ActiveFailover/Limitations.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ Active Failover Limitations
44
The _Active Failover_ setup in ArangoDB has a few limitations. Some of these limitations
55
may be removed in later versions of ArangoDB:
66

7-
- Even though it is already possible to have several _followers_ of the same _leader_,
8-
currently only one _follower_ is officially supported
97
- Should you add more than one _follower_, be aware that during a _failover_ situation
10-
the failover attempts to pick the most up to date follower as a new leader,
11-
but there is **no guarantee** on how much operations may have been lost.
8+
the failover attempts to pick the most up to date follower as the new leader on a **best-effort** basis.
9+
- In contrast to full ArangoDB Cluster (with synchronous replication), there is **no guarantee** on
10+
how many database operations may have been lost during a failover.
11+
- Should you be using the [ArangoDB Starter](../../../Programs/Starter/README.md)
12+
or the [Kubernetes Operator](../../../Deployment/Kubernetes/README.md) to manage your Active-Failover
13+
deployment, be aware that upgrading might trigger an unintentional failover between machines.
14+

0 commit comments

Comments
 (0)
0