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 : pub use postgres_versioninfo::{PgMajorVersion, PgVersionId};
12 :
13 : /// Consensus logical timestamp. Note: it is a part of sk control file.
14 : pub type Term = u64;
15 : /// With this term timeline is created initially. It
16 : /// is a normal term except wp is never elected with it.
17 : pub const INITIAL_TERM: Term = 0;
18 :
19 : /// Information about Postgres. Safekeeper gets it once and then verifies all
20 : /// further connections from computes match. Note: it is a part of sk control
21 : /// file.
22 0 : #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
23 : pub struct ServerInfo {
24 : /// Postgres server version
25 : pub pg_version: PgVersionId,
26 : pub system_id: SystemId,
27 : pub wal_seg_size: u32,
28 : }
29 :
30 : pub const DEFAULT_PG_LISTEN_PORT: u16 = 5454;
31 : pub const DEFAULT_PG_LISTEN_ADDR: &str = formatcp!("127.0.0.1:{DEFAULT_PG_LISTEN_PORT}");
32 :
33 : pub const DEFAULT_HTTP_LISTEN_PORT: u16 = 7676;
34 : pub const DEFAULT_HTTP_LISTEN_ADDR: &str = formatcp!("127.0.0.1:{DEFAULT_HTTP_LISTEN_PORT}");
|