8000 equalising devel and 3.4 in agency/cluster by kvahed · Pull Request #7755 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

equalising devel and 3.4 in agency/cluster #7755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 17, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Apply and reload
Diff view
Next Next commit
equalising devel and 3.4 in agency/cluster
  • Loading branch information
kvahed committed Dec 12, 2018
commit 956d57aebffcf76dbb1947ad13d754481bd63c46
12 changes: 12 additions & 0 deletions arangod/Cluster/SynchronizeShard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ arangodb::Result SynchronizeShard::getReadLock(
size_t count = 0;
size_t maxTries = static_cast<size_t>(std::floor(600.0 / sleepTime));
while (++count < maxTries) { // wait for some time until read lock established:

if (isStopping()) {
return arangodb::Result(TRI_ERROR_SHUTTING_DOWN);
}

// Now check that we hold the read lock:
auto putres = cc->syncRequest(
TRI_NewTickServer(), endpoint, rest::RequestType::PUT, url, body.toJson(),
Expand Down Expand Up @@ -941,6 +946,13 @@ ResultT<TRI_voc_tick_t> SynchronizeShard::catchupWithReadLock(
double timeout = 300.0;
TRI_voc_tick_t tickReached = 0;
while (didTimeout && tries++ < 18) { // This will try to sync for at most 1 hour. (200 * 18 == 3600)

if (isStopping()) {
std::string errorMessage =
"synchronizeOneShard: startReadLockOnLeader (soft): shutting down";
return ResultT<TRI_voc_tick_t>::error(TRI_ERROR_INTERNAL, errorMessage);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should rather be TRI_ERROR_SHUTTING_DOWN than TRI_ERROR_INTERNAL

}

didTimeout = false;
// Now ask for a "soft stop" on the leader, in case of mmfiles, this
// will be a hard stop, but for rocksdb, this is a no-op:
Expand Down
0