(&mut self, collection_id: GlobalId)
| 1042 | /// Calling this method repeatedly has no effect. |
| 1043 | #[mz_ore::instrument(level = "debug")] |
| 1044 | pub fn allow_writes(&mut self, collection_id: GlobalId) -> Result<(), CollectionMissing> { |
| 1045 | let collection = self.collection_mut(collection_id)?; |
| 1046 | |
| 1047 | // Do not send redundant allow-writes commands. |
| 1048 | if !collection.read_only { |
| 1049 | return Ok(()); |
| 1050 | } |
| 1051 | |
| 1052 | // Don't send allow-writes for collections that are not installed. |
| 1053 | let as_of = collection.read_frontier(); |
| 1054 | |
| 1055 | // If the collection has an empty `as_of`, it was either never installed on the replica or |
| 1056 | // has since been dropped. In either case the replica does not expect any commands for it. |
| 1057 | if as_of.is_empty() { |
| 1058 | return Ok(()); |
| 1059 | } |
| 1060 | |
| 1061 | collection.read_only = false; |
| 1062 | self.send(ComputeCommand::AllowWrites(collection_id)); |
| 1063 | |
| 1064 | Ok(()) |
| 1065 | } |
| 1066 | |
| 1067 | /// Shut down this instance. |
| 1068 | /// |
nothing calls this directly
no test coverage detected