| 202 | } |
| 203 | |
| 204 | fn persist_row(&self, key: &[u8], hlc: Hlc) -> crate::Result<()> { |
| 205 | let txn = self.db.begin_write().map_err(|e| crate::Error::Storage { |
| 206 | engine: "array_sync".into(), |
| 207 | detail: format!("ack_registry persist begin_write: {e}"), |
| 208 | })?; |
| 209 | { |
| 210 | let mut table = txn |
| 211 | .open_table(ACK_TABLE) |
| 212 | .map_err(|e| crate::Error::Storage { |
| 213 | engine: "array_sync".into(), |
| 214 | detail: format!("ack_registry persist open_table: {e}"), |
| 215 | })?; |
| 216 | let hlc_bytes = hlc.to_bytes(); |
| 217 | table |
| 218 | .insert(key, hlc_bytes.as_slice()) |
| 219 | .map_err(|e| crate::Error::Storage { |
| 220 | engine: "array_sync".into(), |
| 221 | detail: format!("ack_registry persist insert: {e}"), |
| 222 | })?; |
| 223 | } |
| 224 | txn.commit().map_err(|e| crate::Error::Storage { |
| 225 | engine: "array_sync".into(), |
| 226 | detail: format!("ack_registry persist commit: {e}"), |
| 227 | }) |
| 228 | } |
| 229 | |
| 230 | /// Return the minimum ack HLC across all replicas for `array`. |
| 231 | /// |