aboutsummaryrefslogtreecommitdiff
path: root/src/net/message.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2024-03-28 12:40:27 +0000
committerAlex <alex@adnab.me>2024-03-28 12:40:27 +0000
commitecf641d88c264f7278d13a6d988288feb24a5dfe (patch)
tree5cd60dfa4f0d6d32a66d2e32d7912c9e289067c8 /src/net/message.rs
parent75cd14926d8dec8c36289197822df78391686c6a (diff)
parent85f580cbde4913fe8382316ff3c27b8443c61dd7 (diff)
downloadgarage-ecf641d88c264f7278d13a6d988288feb24a5dfe.tar.gz
garage-ecf641d88c264f7278d13a6d988288feb24a5dfe.zip
Merge pull request 'Fix unbounded buffering when one node has slower network' (#792) from fix-buffering into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/792
Diffstat (limited to 'src/net/message.rs')
-rw-r--r--src/net/message.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net/message.rs b/src/net/message.rs
index b0d255c6..af98ca12 100644
--- a/src/net/message.rs
+++ b/src/net/message.rs
@@ -28,12 +28,30 @@ use crate::util::*;
/// The same priority value is given to a request and to its associated response.
pub type RequestPriority = u8;
+// Usage of priority levels in Garage:
+//
+// PRIO_HIGH
+// for liveness check events such as pings and important
+// reconfiguration events such as layout changes
+//
+// PRIO_NORMAL
+// for standard interactive requests to exchange metadata
+//
+// PRIO_NORMAL | PRIO_SECONDARY
+// for standard interactive requests to exchange block data
+//
+// PRIO_BACKGROUND
+// for background resync requests to exchange metadata
+// PRIO_BACKGROUND | PRIO_SECONDARY
+// for background resync requests to exchange block data
+
/// Priority class: high
pub const PRIO_HIGH: RequestPriority = 0x20;
/// Priority class: normal
pub const PRIO_NORMAL: RequestPriority = 0x40;
/// Priority class: background
pub const PRIO_BACKGROUND: RequestPriority = 0x80;
+
/// Priority: primary among given class
pub const PRIO_PRIMARY: RequestPriority = 0x00;
/// Priority: secondary among given class (ex: `PRIO_HIGH | PRIO_SECONDARY`)