-
Notifications
You must be signed in to change notification settings - Fork 89
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
Pb-4844: Changes in stork for it to enable debug level log messages for kopia operations #1577
Conversation
Can one of the admins verify this patch? |
drivers/volume/kdmp/kdmp.go
Outdated
kdmpData, err := core.Instance().GetConfigMap(stork_driver.KdmpConfigmapName, stork_driver.KdmpConfigmapNamespace) | ||
if err != nil { | ||
logrus.Info("enableKopiaExecutorDebugMode unable to read the cm") | ||
logrus.Tracef("error readig kdmp config map: %v", 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.
nit: Typo on readig
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.
Going to change it to, logrus.warnf and thinking of adding cm name as well, would that be better? @vsundarraj-px
drivers/volume/kdmp/kdmp.go
Outdated
@@ -371,6 +375,24 @@ func (k *kdmp) GetBackupStatus(backup *storkapi.ApplicationBackup) ([]*storkapi. | |||
} | |||
return volumeInfos, nil | |||
} | |||
|
|||
// Check whether to run kopia executor in debug mode |
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.
If its check function, then the function name is missleading. enableKopiaExecutorDebugMode() means enabling it not checking.
Suggestion: IsKopiaExecutorDebugModeEnabled()
drivers/volume/kdmp/kdmp.go
Outdated
|
||
// Check whether to run kopia executor in debug mode | ||
func enableKopiaExecutorDebugMode() bool { | ||
logrus.Info("enableKopiaExecutorDebugMode entering") |
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.
This is ok while developing but not for production, suggestion to remove this info message.
drivers/volume/kdmp/kdmp.go
Outdated
@@ -765,6 +787,12 @@ func (k *kdmp) StartRestore( | |||
dataExport.Annotations[utils.SkipResourceAnnotation] = "true" | |||
dataExport.Annotations[utils.BackupObjectUIDKey] = backupUID | |||
dataExport.Annotations[pvcUIDKey] = bkpvInfo.PersistentVolumeClaimUID | |||
logrus.Info("enableKopiaExecutorDebugMode calling") | |||
if enableKopiaExecutorDebugMode() { | |||
logrus.Info("enableKopiaExecutorDebugMode able to find the debug mode present in kdmp-config cm") |
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.
Redundant Info log. Its already getting printed in check function.. hence this should be removed to reduce logfile payload.
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.
Yup, sorry about this, I forgot to remove log messages while raising the PR
drivers/volume/kdmp/kdmp.go
Outdated
if enableKopiaExecutorDebugMode() { | ||
logrus.Info("enableKopiaExecutorDebugMode able to find the debug mode present in kdmp-config cm") | ||
dataExport.Annotations[utils.KopiaDebugModeEnabled] = "true" | ||
logrus.Info("enableKopiaDebugMode annotation added in the CR") |
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.
Same as above, if you are already checking checkFunction you can avoid this. Or you can remove the log.info in checkfunction() if you are printing here.. Too much of log messages will create high logfile payload.
@@ -361,6 +361,7 @@ func (a *ApplicationRestoreController) handle(ctx context.Context, restore *stor | |||
} | |||
} | |||
|
|||
logrus.Infof("StorageClassMapping restore spec storage class mapping is: %v", restore.Spec.StorageClassMapping) |
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.
Why is this log added in this pR? Merge conflicts?
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.
There was a case when while restoring, storage class was not being taken in destination cluster by default, had used this log to debug and find out the issue, I forgot to remove the all the log messages that I had used while developing. Will be removing these. Thanks for pointing them out!
98f87f1
to
5d7bccd
Compare
c0c241a
to
45d245e
Compare
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.
LGTM
You need resolve PR checks. |
9b5ffbb
to
0cdf4a8
Compare
@kgarg-px Indeed we need not do this way as reconciler code in kdmp does read kdmp-config value (for eg check KopiaResourceRequirements) where we can set kdmp job resoruces on the fly. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## epic-pb-4519 #1577 +/- ##
================================================
- Coverage 67.05% 67.03% -0.02%
================================================
Files 43 43
Lines 5585 5585
================================================
- Hits 3745 3744 -1
- Misses 1501 1502 +1
Partials 339 339 ☔ View full report in Codecov by Sentry. |
741a94b
to
c3c469c
Compare
Signed-off-by: kgarg-px <[email protected]>
What type of PR is this?
What this PR does / why we need it:
This PR introduces a change where we can access debug level logs for kopia operations. We need the this, so that in future whenever required, we could use it to view logs in debug level.
Does this PR change a user-facing CRD or CLI?:
Is a release note needed?:
Does this change need to be cherry-picked to a release branch?:
Link to PX-Backup PR related to this particular PR is: https://github.com/portworx/px-backup/pull/1407
Link to KDMP PR related to this particular PR is: portworx/kdmp#324
Attaching some screenshots for the reference: