fix(deployment): detach each instance's settled rows from the bulk deploy's shared unit of work after Finalize (review 2026-10-21 04/M3)

This commit is contained in:
Joseph Doherty
2026-10-22 06:48:28 -04:00
parent 32e63eaa96
commit 7aacc49043
6 changed files with 100 additions and 1 deletions
@@ -592,6 +592,26 @@ public class DeploySiteAsyncTests : TestKit
Assert.All(sessions, s => Assert.Same(sessions[0], s));
}
/// <summary>
/// review 2026-10-21 04/M3: once an instance is finalised its settled deployment rows are
/// detached from the batch's shared unit of work, so N instances' config JSON is not held
/// (and re-scanned by every later save) for the rest of the batch.
/// </summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task DeploySiteAsync_DetachesEachInstancesSettledRowsAfterFinalize()
{
ArrangeInstances(3);
var applied = new ConcurrentBag<string>();
var commActor = Sys.ActorOf(Props.Create(() => new RecordingSiteActor(applied)));
var result = await CreateService(commActor, maxParallelism: 3).DeploySiteAsync(SiteId, "admin");
Assert.Equal(3, result.Value.SuccessCount);
foreach (var id in new[] { 1, 2, 3 })
_repo.Received(1).DetachSettledDeploymentRows(id);
}
/// <summary>
/// <c>force</c> restores the unconditional behaviour for operators whose
/// site state central cannot see — a restored data volume or a rebuilt node