| 350 | } |
| 351 | |
| 352 | [[nodiscard]] bool createDataSource(std::string_view name, DataSourceHandle* out_source) { |
| 353 | auto engine_locks = lockWriteEngines(engine, secondary_engine); |
| 354 | auto id_or = engine.createDataset(DatasetDescriptor{.source_name = std::string(name), .time_domain_id = 0}); |
| 355 | if (!id_or.has_value()) { |
| 356 | setError(id_or.error()); |
| 357 | return false; |
| 358 | } |
| 359 | *out_source = DataSourceHandle{.id = *id_or}; |
| 360 | last_error.clear(); |
| 361 | return true; |
| 362 | } |
| 363 | |
| 364 | // Idempotent re-mirror of a topic onto the secondary engine. Called on |
| 365 | // every successful ensureTopic path (including cache hits) so a previously |