[#242] pool: Log error that caused healthy status change #242

Merged
fyrchik merged 1 commit from mbiryukova/frostfs-sdk-go:feature/log_unhealthy_error into master 2024-07-23 06:41:58 +00:00
Member

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2024-07-22 08:25:39 +00:00
mbiryukova added 1 commit 2024-07-22 08:25:44 +00:00
[#xxx] pool: Log error that caused healthy status change
Some checks failed
DCO / DCO (pull_request) Failing after 7m2s
Tests and linters / Tests (1.21) (pull_request) Successful in 7m50s
Tests and linters / Tests (1.22) (pull_request) Successful in 7m45s
Tests and linters / Lint (pull_request) Successful in 9m30s
b9728d319b
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova force-pushed feature/log_unhealthy_error from b9728d319b to 93ef8a4202 2024-07-22 08:26:17 +00:00 Compare
mbiryukova changed title from [#xxx] pool: Log error that caused healthy status change to [#242] pool: Log error that caused healthy status change 2024-07-22 08:26:34 +00:00
mbiryukova requested review from storage-core-committers 2024-07-22 08:51:31 +00:00
mbiryukova requested review from storage-core-developers 2024-07-22 08:51:32 +00:00
mbiryukova requested review from storage-sdk-committers 2024-07-22 08:51:33 +00:00
mbiryukova requested review from storage-sdk-developers 2024-07-22 08:51:34 +00:00
mbiryukova requested review from storage-services-committers 2024-07-22 08:51:34 +00:00
mbiryukova requested review from storage-services-developers 2024-07-22 08:51:35 +00:00
dkirillov reviewed 2024-07-22 09:13:14 +00:00
pool/pool.go Outdated
@ -376,2 +376,3 @@
// Return current healthy status and indicating if status was changed by this function call.
func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, changed bool) {
// Returns error that caused unhealthy status.
func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, changed bool, err error) {
Member

What do you think about keeping signature of this method intact but adding logging of error (we know log and error here)?

Or at least consider drop healthy bool from return params. We can know this status from error.

What do you think about keeping signature of this method intact but adding logging of error (we know log and error here)? Or at least consider drop `healthy bool` from return params. We can know this status from error.
Author
Member

I would prefer the second option, because it's like in tree pool

I would prefer the second option, because it's like in tree pool
dkirillov marked this conversation as resolved
mbiryukova force-pushed feature/log_unhealthy_error from 93ef8a4202 to ca7c2e0b8f 2024-07-22 11:49:10 +00:00 Compare
aarifullin reviewed 2024-07-22 11:50:47 +00:00
pool/pool.go Outdated
@ -2211,1 +2211,3 @@
zap.String("address", cli.address()), zap.Bool("healthy", healthy))
fields := []zap.Field{zap.String("address", cli.address()), zap.Bool("healthy", healthy)}
if err != nil {
fields = append(fields, zap.String("error", err.Error()))
Member
  1. It's more correct to use zap.Error formater instead stringifying the error :)
  2. For me "health has changed" with "error" fields seems unclear. It's optinally but I can suggest to log message like health was changed but client error occurred if err != nil
1. It's more correct to use `zap.Error` formater instead stringifying the error :) 2. For me "health has changed" with `"error"` fields seems unclear. It's optinally but I can suggest to log message like `health was changed but client error occurred` if `err != nil`
Owner

ЕМНИП We use zap.String because zap.Error produces unnecessary big stacktraces.

ЕМНИП We use `zap.String` because `zap.Error` produces unnecessary big stacktraces.
Owner

For error I suggest replacing it with a reason, it is not an error related to the operation being logged (health status changed), it is the reason.

For `error` I suggest replacing it with a `reason`, it is not an error related to the operation being logged (health status changed), it is the reason.
mbiryukova force-pushed feature/log_unhealthy_error from ca7c2e0b8f to fa89999d91 2024-07-22 12:13:35 +00:00 Compare
dstepanov-yadro approved these changes 2024-07-22 13:43:12 +00:00
dkirillov approved these changes 2024-07-23 06:39:34 +00:00
fyrchik merged commit fa89999d91 into master 2024-07-23 06:41:58 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-sdk-developers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-sdk-go#242
No description provided.