feat: host tls data service and route node and cluster connections
This commit is contained in:
@@ -390,6 +390,24 @@ public sealed class AdminOperationsActor : ReceiveActor
|
||||
private async Task<ComposeOutcome> ComposeDeploymentAsync(StartDeployment msg, string sourceNode)
|
||||
{
|
||||
await using var db = await _dbFactory.CreateDbContextAsync();
|
||||
// The singleton update obtains a write lock BEFORE reading the draft. The revision and
|
||||
// deployment row remain in this same transaction until the sealed artifact is committed.
|
||||
await using var transaction = db.Database.IsRelational()
|
||||
? await db.Database.BeginTransactionAsync(System.Data.IsolationLevel.Serializable)
|
||||
: null;
|
||||
DataConnectionScopeState scopeState;
|
||||
if (transaction is not null)
|
||||
{
|
||||
var locked = await db.Database.ExecuteSqlRawAsync("UPDATE DataConnectionScopeState SET ScopeVersion = ScopeVersion WHERE Id = 1");
|
||||
if (locked != 1) throw new InvalidOperationException("Authoritative data scope state is unavailable.");
|
||||
scopeState = await db.DataConnectionScopeStates.SingleAsync(x => x.Id == 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Nonrelational providers are used by isolated unit fixtures only.
|
||||
scopeState = await db.DataConnectionScopeStates.SingleOrDefaultAsync(x => x.Id == 1) ?? new DataConnectionScopeState();
|
||||
if (db.Entry(scopeState).State == EntityState.Detached) db.DataConnectionScopeStates.Add(scopeState);
|
||||
}
|
||||
|
||||
// Full pre-seal gate: run the complete DraftValidator (one pass, all rules) and reject
|
||||
// on ANY validation error. The config is now canonical — the company overlay loader emits
|
||||
@@ -523,6 +541,10 @@ public sealed class AdminOperationsActor : ReceiveActor
|
||||
|
||||
// Composed from the validated snapshot, never from a second read: an edit that lands between
|
||||
// validation and here is simply not in this artifact (R03:3.2).
|
||||
var scope = DataConnectionScopeRevision.Advance(scopeState.ScopeVersion, scopeState.Fingerprint, draft.DataConnections);
|
||||
scopeState.ScopeVersion = scope.Version;
|
||||
scopeState.Fingerprint = scope.Fingerprint;
|
||||
draft.DataConnectionScopeVersion = scope.Version;
|
||||
var artifact = ConfigComposer.Compose(draft);
|
||||
var deploymentId = DeploymentId.NewId();
|
||||
var revHash = RevisionHash.Parse(artifact.RevisionHash);
|
||||
@@ -547,6 +569,7 @@ public sealed class AdminOperationsActor : ReceiveActor
|
||||
});
|
||||
|
||||
await db.SaveChangesAsync();
|
||||
if (transaction is not null) await transaction.CommitAsync();
|
||||
|
||||
// Accepted message = the compile-cost advisory (if any) + any Warn-mode TagConfig warnings, so
|
||||
// the operator sees the non-blocking strictness findings on a successful deploy.
|
||||
|
||||
Reference in New Issue
Block a user