blindsidenetworks / scalelite

Scalable load balancer for BigBlueButton.
GNU Affero General Public License v3.0
465 stars 249 forks source link

Apply meta_server-tag from default/override create parameters early in create #1066

Closed Ithanil closed 17 hours ago

Ithanil commented 1 month ago

Description

This PR adds early handling of any meta_server-tag parameter found in DEFAULT_CREATE_PARAMS /OVERRIDE_CREATE_PARAMS or the respective tenantSettings to the create call procedure. This is necessary to ensure the parameter has the desired effect on server selection, which occurs way before the passed create parameters are merged with configured parameters usually. In the later occurring merging of parameters, the meta_server-tag is then excluded, to maintain the fact that the final meta_server-tag parameter is always equal to the chosen server's tag.

This PR is required to make my suggestion in https://github.com/blindsidenetworks/scalelite/issues/1053 actually work.

Testing Steps

Tested combinations of passed vs. configured meta_server-tag via API Mate.

Other notes

At a first glance, e.g. meta_lrs parameters would also require this treatment. I wonder if it would be better to handle all meta parameters early.

Ithanil commented 17 hours ago

@farhatahmad Please let me test this again after I made your suggested change, just to be sure.

Ithanil commented 17 hours ago

After changing the assignment operator from ||= to = the code with your suggested change appears to be fine. With ||= the right hand side will not be evaluated and assigned if the left hand side is a truthy value.