(
storage_engine: &Arc<SOF<RaftTypeConfig<FileStorageEngine, FileStateMachine>>>,
log_ids: Vec<u64>,
term: u64,
)
| 407 | } |
| 408 | |
| 409 | pub async fn manipulate_log( |
| 410 | storage_engine: &Arc<SOF<RaftTypeConfig<FileStorageEngine, FileStateMachine>>>, |
| 411 | log_ids: Vec<u64>, |
| 412 | term: u64, |
| 413 | ) { |
| 414 | let mut entries = Vec::new(); |
| 415 | for id in log_ids { |
| 416 | println!("pre_allocate_raft_logs_next_index: {id}",); |
| 417 | |
| 418 | let log = Entry { |
| 419 | index: id, |
| 420 | term, |
| 421 | payload: Some(EntryPayload::command(generate_insert_commands(vec![id]))), |
| 422 | }; |
| 423 | entries.push(log); |
| 424 | } |
| 425 | assert!(storage_engine.log_store().persist_entries(entries).await.is_ok()); |
| 426 | assert!(storage_engine.log_store().flush().is_ok()); |
| 427 | } |
| 428 | |
| 429 | pub fn init_hard_state( |
| 430 | storage_engine: &Arc<impl StorageEngine>, |
no test coverage detected