LCOV - code coverage report
Current view: top level - libs/safekeeper_api/src - models.rs (source / functions) Coverage Total Hit
Test: 7eb96e224e685167ad85f58f858387d8cf253f63.info Lines: 0.0 % 8 0
Test Date: 2024-09-23 21:23:07 Functions: 0.0 % 57 0

            Line data    Source code
       1              : use serde::{Deserialize, Serialize};
       2              : 
       3              : use utils::{
       4              :     id::{NodeId, TenantId, TimelineId},
       5              :     lsn::Lsn,
       6              : };
       7              : 
       8            0 : #[derive(Serialize, Deserialize)]
       9              : pub struct TimelineCreateRequest {
      10              :     pub tenant_id: TenantId,
      11              :     pub timeline_id: TimelineId,
      12              :     pub peer_ids: Option<Vec<NodeId>>,
      13              :     pub pg_version: u32,
      14              :     pub system_id: Option<u64>,
      15              :     pub wal_seg_size: Option<u32>,
      16              :     pub commit_lsn: Lsn,
      17              :     // If not passed, it is assigned to the beginning of commit_lsn segment.
      18              :     pub local_start_lsn: Option<Lsn>,
      19              : }
      20              : 
      21            0 : fn lsn_invalid() -> Lsn {
      22            0 :     Lsn::INVALID
      23            0 : }
      24              : 
      25              : /// Data about safekeeper's timeline, mirrors broker.proto.
      26            0 : #[derive(Debug, Clone, Deserialize, Serialize)]
      27              : pub struct SkTimelineInfo {
      28              :     /// Term.
      29              :     pub term: Option<u64>,
      30              :     /// Term of the last entry.
      31              :     pub last_log_term: Option<u64>,
      32              :     /// LSN of the last record.
      33              :     #[serde(default = "lsn_invalid")]
      34              :     pub flush_lsn: Lsn,
      35              :     /// Up to which LSN safekeeper regards its WAL as committed.
      36              :     #[serde(default = "lsn_invalid")]
      37              :     pub commit_lsn: Lsn,
      38              :     /// LSN up to which safekeeper has backed WAL.
      39              :     #[serde(default = "lsn_invalid")]
      40              :     pub backup_lsn: Lsn,
      41              :     /// LSN of last checkpoint uploaded by pageserver.
      42              :     #[serde(default = "lsn_invalid")]
      43              :     pub remote_consistent_lsn: Lsn,
      44              :     #[serde(default = "lsn_invalid")]
      45              :     pub peer_horizon_lsn: Lsn,
      46              :     #[serde(default = "lsn_invalid")]
      47              :     pub local_start_lsn: Lsn,
      48              :     /// A connection string to use for WAL receiving.
      49              :     #[serde(default)]
      50              :     pub safekeeper_connstr: Option<String>,
      51              :     #[serde(default)]
      52              :     pub http_connstr: Option<String>,
      53              :     // Minimum of all active RO replicas flush LSN
      54              :     #[serde(default = "lsn_invalid")]
      55              :     pub standby_horizon: Lsn,
      56              : }
      57              : 
      58            0 : #[derive(Debug, Clone, Deserialize, Serialize)]
      59              : pub struct TimelineCopyRequest {
      60              :     pub target_timeline_id: TimelineId,
      61              :     pub until_lsn: Lsn,
      62              : }
      63              : 
      64            0 : #[derive(Debug, Clone, Deserialize, Serialize)]
      65              : pub struct TimelineTermBumpRequest {
      66              :     /// bump to
      67              :     pub term: Option<u64>,
      68              : }
      69              : 
      70            0 : #[derive(Debug, Clone, Deserialize, Serialize)]
      71              : pub struct TimelineTermBumpResponse {
      72              :     // before the request
      73              :     pub previous_term: u64,
      74              :     pub current_term: u64,
      75              : }
        

Generated by: LCOV version 2.1-beta