@@ -94,10 +94,24 @@ cleanup_specs() ->
94
94
ParamsSet = sets :from_list ([ {proplists :get_value (vhost , S ), proplists :get_value (name , S )}
95
95
|| S <- rabbit_runtime_parameters :list_component (<<" shovel" >>) ]),
96
96
F = fun (Name , ok ) ->
97
- _ = mirrored_supervisor :delete_child (? SUPERVISOR , id (Name )),
97
+ try
98
+ % % The supervisor operation is very unlikely to fail, it's the schema
99
+ % % data stores that can make a fuss about a non-existent or non-standard value passed in.
100
+ % % For example, an old style Shovel name is an invalid Khepri query path element. MK.
101
+ _ = mirrored_supervisor :delete_child (? SUPERVISOR , id (Name ))
102
+ catch _ :_ :_Stacktrace ->
103
+ ok
104
+ end ,
98
105
ok
99
106
end ,
100
- AllSpecs = sets :union (NewStyleSpecsSet , OldStyleSpecsSet ),
107
+ % % Khepri won't handle values in OldStyleSpecsSet in its path well. At the same time,
108
+ % % those older elements simply cannot exist in Khepri because having Khepri enabled
109
+ % % means a cluster-wide move to 3.13+, so we can conditionally compute what specs we care about. MK.
110
+ AllSpecs =
111
+ case rabbit_khepri :is_enabled () of
112
+ true -> NewStyleSpecsSet ;
113
+ false -> sets :union (NewStyleSpecsSet , OldStyleSpecsSet )
114
+ end ,
101
115
% % Delete any supervisor children that do not have their respective runtime parameters in the database.
102
116
SetToCleanUp = sets :subtract (AllSpecs , ParamsSet ),
103
117
ok = sets :fold (F , ok , SetToCleanUp ).
0 commit comments