Skip to content

Commit

Permalink
tweak log levels (#2001)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeralsing authored May 12, 2023
1 parent 92bf66e commit c6cdd1f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
4 changes: 0 additions & 4 deletions src/Proto.Cluster/Gossip/Gossiper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ private async Task BlockGracefullyLeft()

if (gracefullyLeft.Any())
{
Logger.LogInformation("Blocking members due to gracefully leaving {Members}", gracefullyLeft);
blockList.Block(gracefullyLeft, "Gracefully left");
}
}
Expand Down Expand Up @@ -288,9 +287,6 @@ where x.Value.Age > _cluster.Config.HeartbeatExpiration

if (blocked.Any())
{
Logger.LogInformation("Blocking members due to expired heartbeat {Members}",
blocked.Cast<object>().ToArray());

blockList.Block(blocked, "Expired heartbeat");
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Proto.Cluster/Member/MemberList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ private void TerminateMember(Member memberThatLeft)
{
var endpointTerminated = new EndpointTerminatedEvent(true, memberThatLeft.Address, memberThatLeft.Id);

if (Logger.IsEnabled(LogLevel.Information))
if (Logger.IsEnabled(LogLevel.Debug))
{
Logger.LogInformation("[MemberList] Published event {@EndpointTerminated}", endpointTerminated);
Logger.LogDebug("[MemberList] Published event {@EndpointTerminated}", endpointTerminated);
}

_cluster.System.EventStream.Publish(endpointTerminated);
Expand Down
23 changes: 13 additions & 10 deletions src/Proto.Cluster/Partition/PartitionIdentityActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ private void ReceiveIdentityHandover(HandoverSink sink, IdentityHandover msg, st
}
}

if (Logger.IsEnabled(LogLevel.Information))
if (Logger.IsEnabled(LogLevel.Debug))
{
Logger.LogInformation(
Logger.LogDebug(
"[PartitionIdentity] Topology {TopologyHash} rebalance completed in {Elapsed}, received {@Stats}",
TopologyHash, _rebalanceTimer?.Elapsed, sink.CompletedHandovers);
}
Expand Down Expand Up @@ -256,10 +256,13 @@ private Task OnClusterTopology(ClusterTopology msg, IContext context)
_currentHandover = new HandoverSink(msg, TakeOverIdentities(context));
_rebalanceTimer = Stopwatch.StartNew();

Logger.LogInformation(
"{SystemId} topology {CurrentTopology} Pausing activations while rebalance in progress, {SpawnCount} spawns waiting",
_cluster.System.Id, TopologyHash, _spawns.Count
);
if (Logger.IsEnabled(LogLevel.Debug))
{
Logger.LogDebug(
"{SystemId} topology {CurrentTopology} Pausing activations while rebalance in progress, {SpawnCount} spawns waiting",
_cluster.System.Id, TopologyHash, _spawns.Count
);
}

if (_config.Mode == PartitionIdentityLookup.Mode.Push) // Good things comes to those who wait
{
Expand Down Expand Up @@ -297,7 +300,7 @@ private Task OnClusterTopology(ClusterTopology msg, IContext context)
}
else
{
Logger.LogError(
Logger.LogWarning(
"[PartitionIdentity] {SystemId} Consensus not reached, Initiating rebalance:, {CurrentTopology} {ConsensusHash} after {Duration}",
_cluster.System.Id, TopologyHash, consensusResult.Result.topologyHash, timer.Elapsed
);
Expand Down Expand Up @@ -412,18 +415,18 @@ private void StartPartitionPull(
ClusterTopology? deltaBaseline = null
)
{
if (Logger.IsEnabled(LogLevel.Information))
if (Logger.IsEnabled(LogLevel.Debug))
{
if (deltaBaseline is not null)
{
Logger.LogInformation(
Logger.LogDebug(
"[PartitionIdentity] Pulling activations between topology {PrevTopology} and {CurrentTopology} from {@MemberAddresses}",
deltaBaseline.TopologyHash, msg.TopologyHash, memberAddresses
);
}
else
{
Logger.LogInformation(
Logger.LogDebug(
"[PartitionIdentity] Pulling activations for topology {CurrentTopology} from {@MemberAddresses}",
msg.TopologyHash,
memberAddresses
Expand Down
13 changes: 8 additions & 5 deletions src/Proto.Cluster/Partition/PartitionIdentityRebalanceWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,14 @@ private Task OnPartitionCompleted(PartitionCompleted response, IContext context)

if (_remainingPartitions.Count == 0)
{
Logger.LogInformation(
"[PartitionIdentity] Pulled activations from {MemberCount} partitions completed in {Elapsed}",
_request!.CurrentTopology.Members.Count,
_timer!.Elapsed
);
if (Logger.IsEnabled(LogLevel.Debug))
{
Logger.LogDebug(
"[PartitionIdentity] Pulled activations from {MemberCount} partitions completed in {Elapsed}",
_request!.CurrentTopology.Members.Count,
_timer!.Elapsed
);
}

context.Self.Stop(context.System);
}
Expand Down

0 comments on commit c6cdd1f

Please sign in to comment.