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
// SPDX-License-Identifier: Apache-2.0
//! Types carried by `MetaOp::RestoreTenantSnapshot` and
//! `MetaOp::CreateTenantSnapshot`.
/// One collection a Raft snapshot install clears on a core before it
/// installs that core's share of the snapshot.
#[derive(
Debug,
Clone,
PartialEq,
Eq,
serde::Serialize,
serde::Deserialize,
zerompk::ToMessagePack,
zerompk::FromMessagePack,
)]
pub struct SnapshotClearTarget {
pub database_id: u64,
pub tenant_id: u64,
/// The name the Data Plane stores the collection under:
/// database-qualified outside the default database.
pub collection: String,
/// Whether this core also removes the collection's shared on-disk L1
/// files. Those paths are keyed by `(database, tenant, collection)`, not
/// by core, so exactly one core per collection (its home core) sets it.
pub reclaim_l1_files: bool,
}
/// A database backup's request to capture its tenants at its cut barrier.
///
/// The barrier each data group's leader places for the backup carries it. The
/// group's leader, when it applies the first barrier of `request_id`,
/// snapshots every tenant of `tenants` in `database_id` before it applies the
/// next entry, and parks the capture for the backup to collect.
#[derive(
Debug,
Clone,
PartialEq,
Eq,
serde::Serialize,
serde::Deserialize,
zerompk::ToMessagePack,
zerompk::FromMessagePack,
)]
pub struct CutCaptureRequest {
/// Unique per backup. It keys every parked capture.
pub request_id: u64,
pub database_id: u64,
pub tenants: Vec<u64>,
}