File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -463,15 +463,18 @@ let resync_host ~__context ~host =
463463 end
464464 else Db.Host. set_updates ~__context ~self: host ~value: [] ;
465465
466- (* Remove any pool_patch objects that don't have a corresponding pool_update object *)
467- Db.Pool_patch. get_all ~__context
468- |> List. filter (fun self -> Db.Pool_patch. get_pool_update ~__context ~self = Ref. null)
469- |> List. iter (fun self -> Db.Pool_patch. destroy ~__context ~self );
470-
471- (* Clean updates that don't have a corresponding patch record *)
472- Db.Pool_update. get_all ~__context
473- |> List. filter (fun self -> Xapi_pool_patch. pool_patch_of_update ~__context self = Ref. null)
474- |> List. iter (fun self -> destroy ~__context ~self )
466+ (* Only clean up existing patches if rolling upgrade has actually finished *)
467+ if not (Helpers. rolling_upgrade_in_progress ~__context) then begin
468+ (* Remove any pool_patch objects that don't have a corresponding pool_update object *)
469+ Db.Pool_patch. get_all ~__context
470+ |> List. filter (fun self -> Db.Pool_patch. get_pool_update ~__context ~self = Ref. null)
471+ |> List. iter (fun self -> Db.Pool_patch. destroy ~__context ~self );
472+
473+ (* Clean updates that don't have a corresponding patch record *)
474+ Db.Pool_update. get_all ~__context
475+ |> List. filter (fun self -> Xapi_pool_patch. pool_patch_of_update ~__context self = Ref. null)
476+ |> List. iter (fun self -> destroy ~__context ~self )
477+ end
475478
476479let pool_update_download_handler (req : Request.t ) s _ =
477480 debug " pool_update.pool_update_download_handler URL %s" req.Request. uri;
You can’t perform that action at this time.
0 commit comments