File: replication_modepb.proto

package info (click to toggle)
golang-github-pingcap-kvproto 6.1.0~alpha-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,040 kB
  • sloc: sh: 111; makefile: 34
file content (60 lines) | stat: -rw-r--r-- 1,714 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
syntax = "proto3";
package replication_modepb;

enum ReplicationMode {
    // The standard mode. Replicate logs to majority peer.
    MAJORITY = 0;
    // DR mode. Replicate logs among 2 DCs.
    DR_AUTO_SYNC = 1;
}

// The replication status sync from PD to TiKV.
message ReplicationStatus {
    ReplicationMode mode = 1;
    DRAutoSync dr_auto_sync = 2;
}

enum DRAutoSyncState {
    // Raft logs need to sync between different DCs
    SYNC = 0;
    // Wait for switching to ASYNC. Stop sync raft logs between DCs.
    ASYNC_WAIT = 1;
    // Raft logs need to sync to majority peers
    ASYNC = 2;
    // Switching from ASYNC to SYNC mode
    SYNC_RECOVER = 3;
}

// The status of dr-autosync mode.
message DRAutoSync {
    // The key of the label that used for distinguish different DC.
    string label_key = 1;
    DRAutoSyncState state = 2;
    // Unique ID of the state, it increases after each state transfer.
    uint64 state_id = 3;
    // Duration to wait before switching to SYNC by force (in seconds)
    int32 wait_sync_timeout_hint = 4;
    // Stores should only sync messages with available stores when state is ASYNC or ASYNC_WAIT.
    repeated uint64 available_stores = 5;
}

enum RegionReplicationState {
    // The region's state is unknown
    UNKNOWN = 0;
    // Logs sync to majority peers
    SIMPLE_MAJORITY = 1;
    // Logs sync to different DCs
    INTEGRITY_OVER_LABEL = 2;
}

// The replication status sync from TiKV to PD.
message RegionReplicationStatus {
    RegionReplicationState state = 1;
    // Unique ID of the state, it increases after each state transfer.
    uint64 state_id = 2;
}

message StoreDRAutoSyncStatus {
    DRAutoSyncState state = 1;
    uint64 state_id = 2;
}