Repository navigation
xapi: Fix pool.join breaking due to dangling ref - #7365
last-genius wants to merge 1 commit into
Conversation
|
I tested this manually - pool.join works after the fix and is broken without it. |
| let remote_fn = Client.SR.forget ~sr in | ||
| with_sr_marked ~__context ~sr ~doc:"SR.forget" ~op:`forget (fun () -> | ||
| Xapi_sr.assert_all_pbds_unplugged ~__context ~sr ; | ||
| Xapi_sr.assert_sr_not_local_cache ~__context ~sr ; |
There was a problem hiding this comment.
With this new assert, if a host is ejected from the pool, and if one of its SR has a local cache, it will raise an exception right? Can't we disable local storage when PBDs are unplugged? Somewhere before https://github.com/xapi-project/xen-api/blob/master/ocaml/xapi/xapi_pool.ml#L2330 maybe. I'm thinking of adding the same function than disable_local_storage_caching but without the "bacon assertion".
Or maybe it is ok for now to accept this kind of failure?
There was a problem hiding this comment.
Damn, you're right, we don't want this to happen. I've dropped the message_forwarding commit, only keeping the guard in xapi_pool
SR.forget can create a dangling reference in Host.local_cache_sr. During
pool join, this will prevent the supporter host from creating its host object
on the coordinator, which leads to a broken supporter host:
[debug||pool.join|xapi_pool] Found no host with uuid = 'SUPPORTER' on the master, so creating one.
[debug||pool.join|xapi_pool] Ignoring exception: Db_exn.DBCache_NotFound("missing row", "SR", "OpaqueRef:DANGLING")
[error||pool.join|backtrace] Raised Db_exn.DBCache_NotFound("missing row", "SR", "OpaqueRef:DANGLING")
[error||pool.join|backtrace] 1/5 xapi Raised at file ocaml/database/db_cache_impl.ml, line 151
[error||pool.join|backtrace] 2/5 xapi Called from file ocaml/xapi/db_actions.ml, line 14885
[error||pool.join|backtrace] 3/5 xapi Called from file ocaml/xapi/xapi_pool.ml, line 1101
[error||pool.join|backtrace] 4/5 xapi Called from file ocaml/xapi/xapi_pool.ml, line 1539
[error||pool.join|backtrace] 5/5 xapi Called from file lib/backtrace.ml, line 110
In case of an error, simply set Host.local_cache_sr to Ref.null and continue.
Thus, after the fix:
[debug||pool.join|xapi_pool] Found no host with uuid = 'SUPPORTER' on the master, so creating one.
[debug||pool.join|xapi_pool] Creating host object on master
Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
c0b7c21 to
1cea848
Compare
SR.forgetcan create a dangling reference inHost.local_cache_sr. Duringpool join, this will prevent the supporter host from creating its host object
on the coordinator, which leads to a broken supporter host:
In case of an error, simply set
Host.local_cache_srtoRef.nulland continue.Thus, after the fix: