-
Notifications
You must be signed in to change notification settings - Fork 714
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
sync
-- log tweaks
#2008
sync
-- log tweaks
#2008
Conversation
@@ -145,6 +145,8 @@ func (m *Manager) Start(ctx context.Context) error { | |||
return ErrAlreadyStarted | |||
} | |||
|
|||
m.config.Log.Info("starting sync", zap.Stringer("target root", m.config.TargetRoot)) |
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.
will help for debugging/showing stuff to user
@@ -539,14 +541,13 @@ func (m *Manager) Wait(ctx context.Context) error { | |||
|
|||
root, err := m.config.DB.GetMerkleRoot(ctx) | |||
if err != nil { | |||
m.config.Log.Info("completed with error", zap.Error(err)) |
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.
I feel like the caller should worry about logging this
@@ -600,7 +604,7 @@ func (m *Manager) setError(err error) { | |||
m.errLock.Lock() | |||
defer m.errLock.Unlock() | |||
|
|||
m.config.Log.Error("syncing failed", zap.Error(err)) | |||
m.config.Log.Error("sync errored", zap.Error(err)) |
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.
syncing
--> sync
for parallelism
@@ -662,7 +666,7 @@ func (m *Manager) completeWorkItem(ctx context.Context, work *workItem, largestH | |||
} | |||
|
|||
// completed the range [work.start, lastKey], log and record in the completed work heap | |||
m.config.Log.Info("completed range", | |||
m.config.Log.Debug("completed range", |
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.
I feel like the user doesn't need to see all these, so made it debug
@@ -568,6 +571,7 @@ func (m *Manager) UpdateSyncTarget(syncTargetRoot ids.ID) error { | |||
return nil | |||
} | |||
|
|||
m.config.Log.Debug("updated sync target", zap.Stringer("target", syncTargetRoot)) |
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.
for debugging
Why this should be merged
See comments
How this works
n/a
How this was tested
n/a