Skip to content

Commit

Permalink
engine: sync only own device before snapshot
Browse files Browse the repository at this point in the history
If a global sync is performed, no flush command arrive to spdk.
Instead, if for every volume a sync over the corresponding
/dev/nvmeXnY is performed, the flush command is correctly
received by spdk_tgt.

Longhorn 7559

Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
  • Loading branch information
DamiaSan authored and shuo-wu committed Mar 15, 2024
1 parent d8ecbfe commit da2a02e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/spdk/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,8 +1097,7 @@ func (e *Engine) snapshotOperation(spdkClient *spdkclient.Client, inputSnapshotN
e.log.WithError(err).Errorf("WARNING: failed to get the executor for snapshot op %v with snapshot %s, will skip the sync and continue", snapshotOp, inputSnapshotName)
} else {
e.log.Infof("Requesting system sync %v before snapshot", devicePath)
// TODO: only sync the device path rather than all filesystems
if _, err := ne.Execute(nil, "sync", []string{}, SyncTimeout); err != nil {
if _, err := ne.Execute(nil, "sync", []string{devicePath}, SyncTimeout); err != nil {
// sync should never fail though, so it more like due to the nsenter
e.log.WithError(err).Errorf("WARNING: failed to sync for snapshot op %v with snapshot %s, will skip the sync and continue", snapshotOp, inputSnapshotName)
}
Expand Down

0 comments on commit da2a02e

Please sign in to comment.