Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logging issues about dual read mode #927

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Conversation

bohhyang
Copy link
Contributor

@bohhyang bohhyang commented Aug 1, 2023

Background

Currently, the dual read mode is logged about being updated without checking whether it's really updated or just setting with the same existing value. Since cluster dual read mode depends on incoming requests to trigger an update when d2 services under that cluster is called, the cluster dual read mode is logged on every request.

Changes

  1. Fix the dual read mode logging to be logged only when there is an update.
  2. When Ads stream is established, log about the Observer authority. It's just the DNS address. The resolved IP address should be logged in ManagedChannelImpl in grpc-core at:
    List<EquivalentAddressGroup> servers = resolutionResult.getAddresses(); channelLogger.log(ChannelLogLevel.INFO, "Address resolved: {0}", servers);

Tests Done

QEI deployment with toki

}

public void updateCluster(String cluster, DualReadModeProvider.DualReadMode mode)
{
_clusterDualReadModes.put(cluster, mode);
LOG.info("Dual read mode for cluster {} updated: {}", cluster, mode);
DualReadModeProvider.DualReadMode oldMode = _clusterDualReadModes.put(cluster, mode);
Copy link
Contributor

@ZoabKapoor ZoabKapoor Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:til:

I didn't know that Map.put returns the original value if it was there!

@bohhyang bohhyang merged commit 47784c3 into master Aug 4, 2023
1 check passed
@bohhyang bohhyang deleted the bohan/indisLoggingFixes branch August 4, 2023 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants