Line data Source code
1 : #![deny(unsafe_code)]
2 : #![deny(clippy::undocumented_unsafe_blocks)]
3 : use const_format::formatcp;
4 : use pq_proto::SystemId;
5 : use serde::{Deserialize, Serialize};
6 :
7 : pub mod membership;
8 : /// Public API types
9 : pub mod models;
10 :
11 : /// Consensus logical timestamp. Note: it is a part of sk control file.
12 : pub type Term = u64;
13 : /// With this term timeline is created initially. It
14 : /// is a normal term except wp is never elected with it.
15 : pub const INITIAL_TERM: Term = 0;
16 :
17 : /// Information about Postgres. Safekeeper gets it once and then verifies all
18 : /// further connections from computes match. Note: it is a part of sk control
19 : /// file.
20 0 : #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
21 : pub struct ServerInfo {
22 : /// Postgres server version
23 : pub pg_version: u32,
24 : pub system_id: SystemId,
25 : pub wal_seg_size: u32,
26 : }
27 :
28 : pub const DEFAULT_PG_LISTEN_PORT: u16 = 5454;
29 : pub const DEFAULT_PG_LISTEN_ADDR: &str = formatcp!("127.0.0.1:{DEFAULT_PG_LISTEN_PORT}");
30 :
31 : pub const DEFAULT_HTTP_LISTEN_PORT: u16 = 7676;
32 : pub const DEFAULT_HTTP_LISTEN_ADDR: &str = formatcp!("127.0.0.1:{DEFAULT_HTTP_LISTEN_PORT}");
|