Acquire a scan guard for `(tid, collection)`. Returns `Ok(None)` if no quiesce registry is installed (e.g. in tests) — callers treat that as "scan unconditionally". Returns `Err(Response)` carrying a `NodeDbError::collection_draining` error code when a drain is in progress against the collection.
(
&self,
task: &crate::data::executor::task::ExecutionTask,
tid: u64,
collection: &str,
)
| 23 | /// carrying a `NodeDbError::collection_draining` error code when |
| 24 | /// a drain is in progress against the collection. |
| 25 | pub(in crate::data::executor) fn acquire_scan_guard( |
| 26 | &self, |
| 27 | task: &crate::data::executor::task::ExecutionTask, |
| 28 | tid: u64, |
| 29 | collection: &str, |
| 30 | ) -> Result<Option<crate::bridge::quiesce::ScanGuard>, crate::bridge::envelope::Response> { |
| 31 | let Some(q) = self.quiesce.as_ref() else { |
| 32 | return Ok(None); |
| 33 | }; |
| 34 | match q.try_start_scan(tid, collection) { |
| 35 | Ok(g) => Ok(Some(g)), |
| 36 | Err(_) => Err(self.response_error( |
| 37 | task, |
| 38 | crate::bridge::envelope::ErrorCode::CollectionDraining { |
| 39 | collection: collection.to_string(), |
| 40 | }, |
| 41 | )), |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | /// Install the encryption key used for vector checkpoint at-rest encryption. |
| 46 | /// |
no test coverage detected