diff --git a/glusterd2/commands/snapshot/snapshot-activate.go b/glusterd2/commands/snapshot/snapshot-activate.go index 5eac6fcef..6ccce5bd5 100644 --- a/glusterd2/commands/snapshot/snapshot-activate.go +++ b/glusterd2/commands/snapshot/snapshot-activate.go @@ -152,6 +152,7 @@ func snapshotActivateHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "snap-activate.StoreSnapshot", UndoFunc: "snap-activate.UndoStoreSnapshot", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, } if err = txn.Do(); err != nil { diff --git a/glusterd2/commands/snapshot/snapshot-clone.go b/glusterd2/commands/snapshot/snapshot-clone.go index c6cb51536..418d2ba30 100644 --- a/glusterd2/commands/snapshot/snapshot-clone.go +++ b/glusterd2/commands/snapshot/snapshot-clone.go @@ -322,6 +322,7 @@ func snapshotCloneHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "snap-clone.CreateCloneVolinfo", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "snap-clone.TakeBrickSnapshots", @@ -332,6 +333,7 @@ func snapshotCloneHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "snap-clone.StoreSnapshot", UndoFunc: "snap-clone.UndoStoreSnapshotOnClone", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, } if err = txn.Ctx.Set("snapname", &snapname); err != nil { diff --git a/glusterd2/commands/snapshot/snapshot-create.go b/glusterd2/commands/snapshot/snapshot-create.go index c432f70d6..89e2760a8 100644 --- a/glusterd2/commands/snapshot/snapshot-create.go +++ b/glusterd2/commands/snapshot/snapshot-create.go @@ -763,6 +763,7 @@ func snapshotCreateHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "snap-create.CreateSnapinfo", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "snap-create.ActivateBarrier", @@ -774,6 +775,8 @@ func snapshotCreateHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "snap-create.TakeBrickSnapshots", UndoFunc: "snap-create.UndoBrickSnapshots", Nodes: txn.Nodes, + // All bricks need to be barriered before taking a snapshot + Sync: true, }, { DoFunc: "snap-create.DeactivateBarrier", @@ -784,6 +787,7 @@ func snapshotCreateHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "snap-create.StoreSnapshot", UndoFunc: "snap-create.UndoStoreSnapshotOnCreate", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, } diff --git a/glusterd2/commands/snapshot/snapshot-deactivate.go b/glusterd2/commands/snapshot/snapshot-deactivate.go index d46129087..5fa9095f9 100644 --- a/glusterd2/commands/snapshot/snapshot-deactivate.go +++ b/glusterd2/commands/snapshot/snapshot-deactivate.go @@ -148,6 +148,7 @@ func snapshotDeactivateHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "snap-deactivate.StoreSnapshot", UndoFunc: "snap-deactivate.UndoStoreSnapshot", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, } if err = txn.Ctx.Set("oldsnapinfo", &snapinfo); err != nil { diff --git a/glusterd2/commands/snapshot/snapshot-delete.go b/glusterd2/commands/snapshot/snapshot-delete.go index c79d5837d..22007ccf8 100644 --- a/glusterd2/commands/snapshot/snapshot-delete.go +++ b/glusterd2/commands/snapshot/snapshot-delete.go @@ -161,6 +161,7 @@ func snapshotDeleteHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "snap-delete.Store", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, } diff --git a/glusterd2/commands/snapshot/snapshot-restore.go b/glusterd2/commands/snapshot/snapshot-restore.go index c3b4483b6..7ba4a3f6b 100644 --- a/glusterd2/commands/snapshot/snapshot-restore.go +++ b/glusterd2/commands/snapshot/snapshot-restore.go @@ -364,6 +364,7 @@ func snapshotRestoreHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "snap-restore.Store", UndoFunc: "snap-restore.UndoStore", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "snap-restore.CleanBricks", diff --git a/glusterd2/commands/volumes/brick-replace.go b/glusterd2/commands/volumes/brick-replace.go index 03163d388..ee2d0e72e 100644 --- a/glusterd2/commands/volumes/brick-replace.go +++ b/glusterd2/commands/volumes/brick-replace.go @@ -161,6 +161,7 @@ LOOP: { DoFunc: "brick-replace.ReplaceVolinfo", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "vol-create.InitBricks", @@ -175,6 +176,7 @@ LOOP: DoFunc: "vol-create.StoreVolume", UndoFunc: "vol-create.UndoStoreVolume", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "vol-expand.NotifyClients", diff --git a/glusterd2/commands/volumes/volume-create.go b/glusterd2/commands/volumes/volume-create.go index f39cc2779..57adfdd63 100644 --- a/glusterd2/commands/volumes/volume-create.go +++ b/glusterd2/commands/volumes/volume-create.go @@ -177,8 +177,9 @@ func volumeCreateHandler(w http.ResponseWriter, r *http.Request) { }, { DoFunc: "vol-create.ValidateBricks", - Sync: true, Nodes: nodes, + // Need to wait for volinfo to be created first + Sync: true, }, { DoFunc: "vol-create.InitBricks", @@ -189,6 +190,7 @@ func volumeCreateHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "vol-create.StoreVolume", UndoFunc: "vol-create.UndoStoreVolume", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, } diff --git a/glusterd2/commands/volumes/volume-delete.go b/glusterd2/commands/volumes/volume-delete.go index f876b52f4..8daa54f2e 100644 --- a/glusterd2/commands/volumes/volume-delete.go +++ b/glusterd2/commands/volumes/volume-delete.go @@ -81,6 +81,7 @@ func volumeDeleteHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "vol-delete.Store", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, } diff --git a/glusterd2/commands/volumes/volume-expand.go b/glusterd2/commands/volumes/volume-expand.go index d95f5e146..b638ca7f7 100644 --- a/glusterd2/commands/volumes/volume-expand.go +++ b/glusterd2/commands/volumes/volume-expand.go @@ -176,6 +176,8 @@ func volumeExpandHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "vol-expand.ValidateBricks", Nodes: nodes, Skip: lvmResizeOp, + // Need to wait for newly selected bricks to be set by the previous step + Sync: true, }, { DoFunc: "vol-expand.InitBricks", @@ -193,11 +195,13 @@ func volumeExpandHandler(w http.ResponseWriter, r *http.Request) { UndoFunc: "vol-create.UndoStoreVolume", Nodes: []uuid.UUID{gdctx.MyUUID}, Skip: !lvmResizeOp, + Sync: true, }, { DoFunc: "vol-expand.UpdateVolinfo", Nodes: []uuid.UUID{gdctx.MyUUID}, Skip: lvmResizeOp, + Sync: true, }, { DoFunc: "vol-expand.GenerateBrickVolfiles", diff --git a/glusterd2/commands/volumes/volume-option.go b/glusterd2/commands/volumes/volume-option.go index 33e4e1989..7855d6a7a 100644 --- a/glusterd2/commands/volumes/volume-option.go +++ b/glusterd2/commands/volumes/volume-option.go @@ -241,6 +241,7 @@ func volumeOptionsHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "vol-option.UpdateVolinfo", UndoFunc: "vol-option.UpdateVolinfo.Undo", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "vol-option.XlatorActionDoSet", diff --git a/glusterd2/commands/volumes/volume-reset.go b/glusterd2/commands/volumes/volume-reset.go index 78f08a4c5..ad465c127 100644 --- a/glusterd2/commands/volumes/volume-reset.go +++ b/glusterd2/commands/volumes/volume-reset.go @@ -138,11 +138,13 @@ func volumeResetHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "vol-option.UpdateVolinfo", UndoFunc: "vol-option.UpdateVolinfo.Undo", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "vol-option.GenerateBrickVolfiles", UndoFunc: "vol-option.GenerateBrickvolfiles.Undo", Nodes: volinfo.Nodes(), + Sync: true, }, { DoFunc: "vol-option.NotifyVolfileChange", diff --git a/glusterd2/commands/volumes/volume-start.go b/glusterd2/commands/volumes/volume-start.go index 320c9fe1b..45c49cfd0 100644 --- a/glusterd2/commands/volumes/volume-start.go +++ b/glusterd2/commands/volumes/volume-start.go @@ -171,6 +171,7 @@ func volumeStartHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "vol-start.UpdateVolinfo", UndoFunc: "vol-start.UpdateVolinfo.Undo", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "vol-start.XlatorActionDoVolumeStart", diff --git a/glusterd2/commands/volumes/volume-stop.go b/glusterd2/commands/volumes/volume-stop.go index 7b827c03c..1844be527 100644 --- a/glusterd2/commands/volumes/volume-stop.go +++ b/glusterd2/commands/volumes/volume-stop.go @@ -152,6 +152,7 @@ func volumeStopHandler(w http.ResponseWriter, r *http.Request) { DoFunc: "vol-stop.UpdateVolinfo", UndoFunc: "vol-stop.UpdateVolinfo.Undo", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, { DoFunc: "vol-stop.XlatorActionDoVolumeStop", diff --git a/plugins/bitrot/rest.go b/plugins/bitrot/rest.go index 3a6f0fca3..e7542e94c 100644 --- a/plugins/bitrot/rest.go +++ b/plugins/bitrot/rest.go @@ -78,6 +78,8 @@ func bitrotEnableHandler(w http.ResponseWriter, r *http.Request) { // Required because bitrot-stub should be enabled on brick side DoFunc: "vol-option.NotifyVolfileChange", Nodes: txn.Nodes, + // Volinfo needs to be updated before sending notifications + Sync: true, }, { DoFunc: "bitrot-enable.Commit", diff --git a/plugins/georeplication/rest.go b/plugins/georeplication/rest.go index 6b8b10729..50a9dc887 100644 --- a/plugins/georeplication/rest.go +++ b/plugins/georeplication/rest.go @@ -197,6 +197,8 @@ func georepCreateHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "vol-option.NotifyVolfileChange", Nodes: txn.Nodes, + // Volinfo needs to be updated before sending notifications + Sync: true, }, { DoFunc: "georeplication-create.Commit", @@ -786,6 +788,8 @@ func georepConfigSetHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "georeplication-configfilegen.Commit", Nodes: txn.Nodes, + // Config needs to be set before config file can be generated + Sync: true, }, } @@ -919,6 +923,8 @@ func georepConfigResetHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "georeplication-configfilegen.Commit", Nodes: txn.Nodes, + // Config needs to be set before config file can be generated + Sync: true, }, } diff --git a/plugins/rebalance/rest.go b/plugins/rebalance/rest.go index 84e946ef9..ec82a6102 100644 --- a/plugins/rebalance/rest.go +++ b/plugins/rebalance/rest.go @@ -96,6 +96,7 @@ func rebalanceStartHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "rebalance-store", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, } @@ -186,6 +187,7 @@ func rebalanceStopHandler(w http.ResponseWriter, r *http.Request) { { DoFunc: "rebalance-store", Nodes: []uuid.UUID{gdctx.MyUUID}, + Sync: true, }, }