Skip to content

Commit

Permalink
Merge pull request tikv#11 from bufferflies/tony/snapshot_send_recv
Browse files Browse the repository at this point in the history
raftstore-v2 send recv snapshot
  • Loading branch information
tonyxuqqi committed Nov 14, 2022
2 parents 51a5bdf + 20bb3a8 commit 3dbf4c7
Show file tree
Hide file tree
Showing 4 changed files with 440 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/raftstore/src/store/async_io/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use raft::{eraftpb::Snapshot, GetEntriesContext};
use tikv_util::{error, info, time::Instant, worker::Runnable};

use crate::store::{
snap::TABLET_SNAPSHOT_VERSION,
util,
worker::metrics::{SNAP_COUNTER, SNAP_HISTOGRAM},
RaftlogFetchResult, TabletSnapKey, TabletSnapManager, MAX_INIT_ENTRY_COUNT,
Expand Down Expand Up @@ -215,6 +216,7 @@ where
// Set snapshot data.
let mut snap_data = RaftSnapshotData::default();
snap_data.set_region(region_state.get_region().clone());
snap_data.set_version(TABLET_SNAPSHOT_VERSION);
snap_data.mut_meta().set_for_balance(for_balance);
snapshot.set_data(snap_data.write_to_bytes().unwrap().into());

Expand Down
1 change: 1 addition & 0 deletions components/raftstore/src/store/snap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub const SNAPSHOT_CFS_ENUM_PAIR: &[(CfNames, CfName)] = &[
(CfNames::write, CF_WRITE),
];
pub const SNAPSHOT_VERSION: u64 = 2;
pub const TABLET_SNAPSHOT_VERSION: u64 = 3;
pub const IO_LIMITER_CHUNK_SIZE: usize = 4 * 1024;

/// Name prefix for the self-generated snapshot file.
Expand Down
1 change: 1 addition & 0 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub mod server;
pub mod service;
pub mod snap;
pub mod status_server;
pub mod tablet_snap;
pub mod transport;
pub mod ttl;

Expand Down
Loading

0 comments on commit 3dbf4c7

Please sign in to comment.