blob: 123bc7a57e5e89f9ba75c36ba0cbe5ead807c518 [file] [log] [blame]
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __LOG_CATCHUP_HPP__
#define __LOG_CATCHUP_HPP__
#include <stdint.h>
#include <process/future.hpp>
#include <process/shared.hpp>
#include <stout/duration.hpp>
#include <stout/interval.hpp>
#include <stout/nothing.hpp>
#include <stout/option.hpp>
#include "log/network.hpp"
#include "log/replica.hpp"
namespace mesos {
namespace internal {
namespace log {
// Catches-up a set of log positions in the local replica. The user of
// this function can provide a hint on the proposal number that will
// be used for Paxos. This could potentially save us a few Paxos
// rounds. However, if the user has no idea what proposal number to
// use, they can just use none. We also allow the user to specify a
// timeout for the catch-up operation on each position and retry the
// operation if timeout happens. This can help us tolerate network
// blips.
extern process::Future<Nothing> catchup(
size_t quorum,
const process::Shared<Replica>& replica,
const process::Shared<Network>& network,
const Option<uint64_t>& proposal,
const IntervalSet<uint64_t>& positions,
const Duration& timeout = Seconds(10));
} // namespace log {
} // namespace internal {
} // namespace mesos {
#endif // __LOG_CATCHUP_HPP__