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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// SPDX-License-Identifier: BUSL-1.1
//! Wire version constants + static compatibility checks.
//!
//! See `view::ClusterVersionView` for the live-topology-derived
//! feature-gate predicates.
use ClusterVersionView;
use crateWIRE_FORMAT_VERSION;
/// Wire-format version that introduced the replicated catalog DDL
/// path (`CatalogEntry` proposed via the metadata raft group).
///
/// Before this version, catalog DDL was applied directly on the
/// originating node and never replicated. Mixing the two paths in
/// a rolling upgrade window would silently diverge state across
/// nodes, so [`crate::control::metadata_proposer::propose_catalog_entry`]
/// gates on this constant via
/// [`ClusterVersionView::can_activate_feature`] and falls back to
/// the legacy direct-write path until every node in the cluster
/// has caught up.
pub const DISTRIBUTED_CATALOG_VERSION: u16 = 2;
/// Wire-format version that introduced monotonic descriptor
/// versioning (`descriptor_version: u64` + `modification_hlc: Hlc`
/// on every `Stored*` type stamped by the metadata applier at
/// commit time).
///
/// Before this version, `Stored*` records had no version / HLC
/// fields on the wire. In a mixed-version cluster during rolling
/// upgrade, an older applier would fail to re-stamp on
/// write-through (it has no stamp logic), so we keep the stamping
/// path disabled in compat mode and let resolvers treat
/// `descriptor_version == 0` as "unknown, always re-fetch". Once
/// every node reports `wire_version >= 3`, the applier transitions
/// to stamping.
pub const DESCRIPTOR_VERSIONING_VERSION: u16 = 3;
/// Wire version that introduced the replicated
/// `DescriptorDrainStart` / `DescriptorDrainEnd` metadata entries.
/// Mixed-version clusters below this version skip drain via the
/// compat-mode fallback in `drain_for_ddl`.
pub const DESCRIPTOR_DRAIN_VERSION: u16 = 4;
/// Check if a message from a remote node should be accepted.
///
/// Accepts only messages with the exact current wire format version.
/// Any other version is rejected (floor == ceiling; no rolling-upgrade window).
/// Determine if this node should operate in compatibility mode.
///
/// Compat mode is active when the cluster has mixed versions. In
/// compat mode, new features that require the latest version are
/// disabled.