-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
wal: add "etcd_wal_writes_bytes_total" #11738
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,10 @@ import ( | |
"io" | ||
"os" | ||
"path/filepath" | ||
"time" | ||
|
||
"go.etcd.io/etcd/pkg/fileutil" | ||
"go.etcd.io/etcd/wal/walpb" | ||
|
||
"go.uber.org/zap" | ||
) | ||
|
||
|
@@ -86,10 +86,12 @@ func Repair(lg *zap.Logger, dirpath string) bool { | |
return false | ||
} | ||
|
||
start := time.Now() | ||
if err = fileutil.Fsync(f.File); err != nil { | ||
Comment on lines
+89
to
90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to calculate metrics inside There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
lg.Warn("failed to fsync", zap.String("path", f.Name()), zap.Error(err)) | ||
return false | ||
} | ||
walFsyncSec.Observe(time.Since(start).Seconds()) | ||
|
||
lg.Info("repaired", zap.String("path", f.Name()), zap.Error(io.ErrUnexpectedEOF)) | ||
return true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
Flush()
be deprecated or even removed? Otherwise, the metrics whereFlushN
captured isn't complete?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was an external package, so there could be other projects importing this method. So we rather keep it.