@@ -3600,11 +3600,13 @@ Future<Result> Methods::replicateOperations(
3600
3600
// we continue with the operation, since most likely, the follower was
3601
3601
// simply dropped in the meantime.
3602
3602
// In any case, we drop the follower here (just in case).
3603
- auto cb = [=, this ](std::vector<futures::Try<network::Response>>&& responses)
3603
+ auto cb = [followerList, startTimeReplication, opName, collection, count,
3604
+ vocbase = vocbase ().getSharedPtr (), state = _state](
3605
+ std::vector<futures::Try<network::Response>>&& responses)
3604
3606
-> futures::Future<Result> {
3605
3607
auto duration = std::chrono::steady_clock::now () - startTimeReplication;
3606
3608
auto & replMetrics =
3607
- vocbase (). server ().getFeature <ReplicationMetricsFeature>();
3609
+ vocbase-> server ().getFeature <ReplicationMetricsFeature>();
3608
3610
replMetrics.synchronousOpsTotal () += 1 ;
3609
3611
replMetrics.synchronousTimeTotal () +=
3610
3612
std::chrono::nanoseconds (duration).count ();
@@ -3642,8 +3644,7 @@ Future<Result> Methods::replicateOperations(
3642
3644
// follower, but simply return the error and abort our local
3643
3645
// transaction.
3644
3646
if (r.is (TRI_ERROR_TRANSACTION_ABORTED) &&
3645
- this ->state ()->hasHint (
3646
- transaction::Hints::Hint::FROM_TOPLEVEL_AQL)) {
3647
+ state->hasHint (transaction::Hints::Hint::FROM_TOPLEVEL_AQL)) {
3647
3648
return r;
3648
3649
}
3649
3650
@@ -3655,8 +3656,7 @@ Future<Result> Methods::replicateOperations(
3655
3656
absl::StrCat (" got error from follower: " , r.errorMessage ());
3656
3657
3657
3658
if (followerRefused) {
3658
- ++vocbase ()
3659
- .server ()
3659
+ ++vocbase->server ()
3660
3660
.getFeature <arangodb::ClusterFeature>()
3661
3661
.followersRefusedCounter ();
3662
3662
@@ -3676,7 +3676,7 @@ Future<Result> Methods::replicateOperations(
3676
3676
}
3677
3677
3678
3678
if (!replicationFailureReason.empty ()) {
3679
- if (!vocbase (). server ().isStopping ()) {
3679
+ if (!vocbase-> server ().isStopping ()) {
3680
3680
LOG_TOPIC (" 12d8c" , WARN, Logger::REPLICATION)
3681
3681
<< " synchronous replication of " << opName << " operation "
3682
3682
<< " (" << count << " doc(s)): "
@@ -3738,7 +3738,7 @@ Future<Result> Methods::replicateOperations(
3738
3738
return Result{TRI_ERROR_CLUSTER_SHARD_LEADER_RESIGNED};
3739
3739
} else {
3740
3740
// execute a deferred intermediate commit, if required.
3741
- return performIntermediateCommitIfRequired (collection->id ());
3741
+ return state-> performIntermediateCommitIfRequired (collection->id ());
3742
3742
}
3743
3743
};
3744
3744
return futures::collectAll (std::move (futures)).thenValue (std::move (cb));
0 commit comments