@@ -1963,6 +1963,7 @@ let eject_self ~__context ~host =
19631963 (Db.Pool. get_current_operations ~__context ~self: pool)
19641964 then
19651965 raise Api_errors. (Server_error (not_supported_during_upgrade, [] )) ;
1966+ let last_update_hash = Db.Host. get_last_update_hash ~__context ~self: host in
19661967 if Pool_role. is_master () then
19671968 raise Cannot_eject_master
19681969 else (* Fail the operation if any VMs are running here (except dom0) *)
@@ -2093,6 +2094,8 @@ let eject_self ~__context ~host =
20932094 pif.API. pIF_ipv6_configuration_mode
20942095 |> String. uncapitalize_ascii
20952096 in
2097+ Localdb. put " last_update_hash" last_update_hash ;
2098+ debug " Saved last_update_hash %S to localdb." last_update_hash ;
20962099 let write_first_boot_management_interface_configuration_file () =
20972100 (* During firstboot, now inventory has an empty MANAGEMENT_INTERFACE *)
20982101 let bridge = " " in
@@ -3705,8 +3708,16 @@ let set_repositories ~__context ~self ~value =
37053708 )
37063709 value ;
37073710 Db.Pool. set_repositories ~__context ~self ~value ;
3708- if Db.Pool. get_repositories ~__context ~self = [] then
3711+ if Db.Pool. get_repositories ~__context ~self = [] then (
37093712 Db.Pool. set_last_update_sync ~__context ~self ~value: Date. epoch ;
3713+ (* The host.latest_synced_updates_applied can't be refreshed by
3714+ pool.sync_updates. So reset it here. *)
3715+ Db.Host. get_all ~__context
3716+ |> List. iter (fun h ->
3717+ Db.Host. set_latest_synced_updates_applied ~__context ~self: h
3718+ ~value: `unknown
3719+ )
3720+ ) ;
37103721 disable_unsupported_periodic_sync_updates ~__context ~self ~repos: value
37113722
37123723let add_repository ~__context ~self ~value =
0 commit comments