Skip to content
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

[Raft] make me crazy #3172

Merged
merged 15 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
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
Diff view
2 changes: 1 addition & 1 deletion conf/nebula-storaged.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
--enable_rocksdb_whole_key_filtering=false

############### misc ####################
--snapshot_part_rate_limit=8388608
--snapshot_part_rate_limit=10485760
--snapshot_batch_size=1048576
--rebuild_index_part_rate_limit=4194304
--rebuild_index_batch_size=1048576
2 changes: 1 addition & 1 deletion src/common/base/SlowOpTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#include "common/base/Base.h"
#include "common/time/WallClock.h"

DEFINE_int64(slow_op_threshhold_ms, 50, "default threshhold for slow operation");
DEFINE_int64(slow_op_threshhold_ms, 100, "default threshhold for slow operation");
40 changes: 18 additions & 22 deletions src/interface/raftex.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,27 @@ cpp_include "common/thrift/ThriftTypes.h"
enum ErrorCode {
SUCCEEDED = 0;

E_LOG_GAP = -1;
E_LOG_STALE = -2;
E_MISSING_COMMIT = -3;
E_WAITING_SNAPSHOT = -4; // The follower is waiting a snapshot

E_UNKNOWN_PART = -5;
E_TERM_OUT_OF_DATE = -6;
E_LAST_LOG_TERM_TOO_OLD = -7;
E_BAD_STATE = -8;
E_WRONG_LEADER = -9;
E_WAL_FAIL = -10;
E_NOT_READY = -11;
E_UNKNOWN_PART = -1;

// Local errors
E_HOST_STOPPED = -12;
E_NOT_A_LEADER = -13;
E_HOST_DISCONNECTED = -14;
E_TOO_MANY_REQUESTS = -15;
E_PERSIST_SNAPSHOT_FAILED = -16;
// Raft consensus errors
E_LOG_GAP = -2;
E_LOG_STALE = -3;
E_TERM_OUT_OF_DATE = -4;

E_BAD_ROLE = -17,
// Raft state errors
E_WAITING_SNAPSHOT = -5; // The follower is waiting a snapshot
E_BAD_STATE = -6;
E_WRONG_LEADER = -7;
E_NOT_READY = -8;
E_BAD_ROLE = -9,

E_EXCEPTION = -20; // An thrift internal exception was thrown
// Local errors
E_WAL_FAIL = -10;
E_HOST_STOPPED = -11;
E_TOO_MANY_REQUESTS = -12;
E_PERSIST_SNAPSHOT_FAILED = -13;
E_RPC_EXCEPTION = -14; // An thrift internal exception was thrown
E_NO_WAL_FOUND = -15;
}

typedef i64 (cpp.type = "nebula::ClusterID") ClusterID
Expand Down Expand Up @@ -103,8 +101,6 @@ struct AppendLogRequest {
//
10: TermID log_term;
11: list<LogEntry> log_str_list;

12: bool sending_snapshot;
}


Expand Down
4 changes: 2 additions & 2 deletions src/kvstore/NebulaSnapshotManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "kvstore/RateLimiter.h"

DEFINE_uint32(snapshot_part_rate_limit,
1024 * 1024 * 8,
1024 * 1024 * 10,
"max bytes of pulling snapshot for each partition in one second");
DEFINE_uint32(snapshot_batch_size, 1024 * 512, "batch size for snapshot, in bytes");

Expand All @@ -21,7 +21,7 @@ const int32_t kReserveNum = 1024 * 4;

NebulaSnapshotManager::NebulaSnapshotManager(NebulaStore* kv) : store_(kv) {
// Snapshot rate is limited to FLAGS_snapshot_worker_threads * FLAGS_snapshot_part_rate_limit.
// So by default, the total send rate is limited to 4 * 8Mb = 32Mb.
// So by default, the total send rate is limited to 4 * 10Mb = 40Mb.
LOG(INFO) << "Send snapshot is rate limited to " << FLAGS_snapshot_part_rate_limit
<< " for each part by default";
}
Expand Down
Loading