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

Remove ERROR level log on failed no-ops #1692

Closed
alecgrieser opened this issue May 24, 2022 · 0 comments · Fixed by #1693
Closed

Remove ERROR level log on failed no-ops #1692

alecgrieser opened this issue May 24, 2022 · 0 comments · Fixed by #1693
Assignees
Labels
enhancement New feature or request

Comments

@alecgrieser
Copy link
Contributor

Right now, we log at ERROR if there is a failure when performing a no-op, even though we propagate the error. See:

private void logNoOpFailure(@Nonnull Throwable err) {
if (LOGGER.isErrorEnabled()) {
LOGGER.error(KeyValueLogMessage.of("unable to perform no-op operation against fdb",
LogMessageKeys.CLUSTER, getClusterFile()), err);
}
}

However, this is a bit misleading, for a few reasons:

  1. No-ops can fail, and it shouldn't be classified as an ERROR. The most likely reason for this is that when the client is starting up (if using the multi-version client), then a no-op can fail with "cluster version changed".
  2. The error is getting propagated up anyway. The only additional information is maybe what cluster is being used, which may be helpful in a world where different clusters are configured to use different network threads.

We should be able to remove this ERROR-level log and replace it with something that adds the cluster to the error log info. Then clients can decide at what level they want to log this, rather than potentially polluting their logs with (ultimately) spurious errors.

@alecgrieser alecgrieser added the enhancement New feature or request label May 24, 2022
@alecgrieser alecgrieser self-assigned this May 24, 2022
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this issue May 24, 2022
This removes the `ERROR`-level log on no-op failure. The error was already getting propagated, and that, in practice, should be enough for adopters to detect errors and (if they so desire) log the error. I considered adding logic to include the `cluster` as logging details, but that ended up being a little bit delicate because it only works if the underlying failure is a `LoggableException`, which isn't necessarily the case because we haven't called the error-wrapping logic at that point. So, it was easier to just leave it without that information, and it didn't seem like a huge loss, as the caller should be able to determine that based on the fact that they need an `FDBDatabase` to call this on anyway.

This resolves FoundationDB#1692.
MMcM added a commit that referenced this issue May 24, 2022
Resolves #1692: Remove ERROR level log on failed no-ops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant