fix(communication): site pair log lines name the target site, not the logging node (#136)
The channel-pair log templates used {SiteId}, which collides with the
node's own enriched SiteId property, so the failover warning read
"Site central node A unavailable...". Renamed to {TargetSiteId} in all
six templates in SitePairChannelProvider.
Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
This commit is contained in:
@@ -180,7 +180,7 @@ public sealed class SitePairChannelProvider : IDisposable
|
||||
pair.FailbackOnProbation = false;
|
||||
pair.ResetFailback();
|
||||
_logger.LogInformation(
|
||||
"gRPC channel pair for site {SiteId} refreshed (nodeA={HasA}, nodeB={HasB})",
|
||||
"gRPC channel pair for site {TargetSiteId} refreshed (nodeA={HasA}, nodeB={HasB})",
|
||||
siteId, pair.ChannelA is not null, pair.ChannelB is not null);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ public sealed class SitePairChannelProvider : IDisposable
|
||||
if (!string.Equals(isA ? pair.RejectedAEndpoint : pair.RejectedBEndpoint, endpoint, StringComparison.Ordinal))
|
||||
{
|
||||
_logger.LogError(buildError,
|
||||
"Site {SiteId} {Field} '{Endpoint}' is not a usable gRPC endpoint ({Error}); keeping the "
|
||||
"Site {TargetSiteId} {Field} '{Endpoint}' is not a usable gRPC endpoint ({Error}); keeping the "
|
||||
+ "previous channel ({Previous}) for that node until the address is corrected",
|
||||
siteId, field, endpoint, error, (isA ? pair.NodeAEndpoint : pair.NodeBEndpoint) ?? "none");
|
||||
SetRejected(pair, isA, endpoint);
|
||||
@@ -270,7 +270,7 @@ public sealed class SitePairChannelProvider : IDisposable
|
||||
pair.ChannelB = null;
|
||||
}
|
||||
_pskProvider.Invalidate(siteId);
|
||||
_logger.LogInformation("gRPC channel pair for site {SiteId} removed", siteId);
|
||||
_logger.LogInformation("gRPC channel pair for site {TargetSiteId} removed", siteId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -334,7 +334,7 @@ public sealed class SitePairChannelProvider : IDisposable
|
||||
if (secondary is null) throw;
|
||||
// Only reads/idempotent operations or a provably unapplied request may replay.
|
||||
_logger.LogWarning(
|
||||
"Site {SiteId} node {FromNode} unavailable; failing over to node {ToNode}",
|
||||
"Site {TargetSiteId} node {FromNode} unavailable; failing over to node {ToNode}",
|
||||
siteId, primaryIsA ? "A" : "B", primaryIsA ? "B" : "A");
|
||||
try { return await call(secondary, ct).ConfigureAwait(false); }
|
||||
catch (RpcException retryError) when (retryError.StatusCode == StatusCode.Unavailable
|
||||
@@ -388,7 +388,7 @@ public sealed class SitePairChannelProvider : IDisposable
|
||||
pair.FailbackOnProbation = true;
|
||||
pair.ProbationSinceUtc = DateTime.UtcNow;
|
||||
pair.NextProbeUtc = DateTime.MaxValue;
|
||||
_logger.LogInformation("Site {SiteId} preferred node A ready again; failing back", siteId);
|
||||
_logger.LogInformation("Site {TargetSiteId} preferred node A ready again; failing back", siteId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ public sealed class SitePairChannelProvider : IDisposable
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogDebug(ex, "Failback probe for site {SiteId} faulted", kvp.Key);
|
||||
_logger.LogDebug(ex, "Failback probe for site {TargetSiteId} faulted", kvp.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user