| 383 | } |
| 384 | |
| 385 | ACTOR static Future<Void> commit(ConfigNodeImpl* self, ConfigTransactionCommitRequest req) { |
| 386 | ConfigGeneration currentGeneration = wait(getGeneration(self)); |
| 387 | if (req.generation.committedVersion != currentGeneration.committedVersion) { |
| 388 | ++self->failedCommits; |
| 389 | req.reply.sendError(commit_unknown_result()); |
| 390 | return Void(); |
| 391 | } else if (req.generation.liveVersion != currentGeneration.liveVersion) { |
| 392 | ++self->failedCommits; |
| 393 | req.reply.sendError(not_committed()); |
| 394 | return Void(); |
| 395 | } |
| 396 | Standalone<VectorRef<VersionedConfigMutationRef>> mutations; |
| 397 | for (const auto& mutation : req.mutations) { |
| 398 | mutations.emplace_back_deep(mutations.arena(), req.generation.liveVersion, mutation); |
| 399 | } |
| 400 | Standalone<VectorRef<VersionedConfigCommitAnnotationRef>> annotations; |
| 401 | annotations.emplace_back_deep(annotations.arena(), req.generation.liveVersion, req.annotation); |
| 402 | wait(commitMutations(self, mutations, annotations, req.generation.liveVersion)); |
| 403 | req.reply.send(Void()); |
| 404 | return Void(); |
| 405 | } |
| 406 | |
| 407 | ACTOR static Future<Void> serve(ConfigNodeImpl* self, ConfigTransactionInterface const* cti) { |
| 408 | loop { |
nothing calls this directly
no test coverage detected