Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for semicolon-separated list of tags on create calls #1127

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Ithanil
Copy link
Collaborator

@Ithanil Ithanil commented Dec 3, 2024

This PR enables support for semicolon-separated lists of tags as meta_server-tag argument in create calls, which then matches all servers with any of the tags in the list. It also introduces none as a special tag to explicitly reference untagged servers.

Description

The following is a part of the updated documentation and describes how the feature works now:

A create API call using this feature is supposed to work as follows:

  1. When making a "create" API call towards Scalelite, you can optionally pass a meta_server-tag parameter with a string value. The string can be a single tag or a semicolon-separated list of tags and may additionally contain a '!' as last character. It will be handled as follows:
  2. If the last character of meta_server-tag is not a '!', the tags will will be intepreted as optional. The meeting will be created on the least loaded server with a tag matching one of the passed tags (the special tag 'none' will match untagged servers), if any is available, or on the least loaded untagged server otherwise.
  3. If the last character of meta_server-tag is a '!', this character will be stripped and the remaining tags will be interpreted as required. The meeting will be created on the least loaded server with a tag matching one of the passed tags (the special tag 'none' will match untagged servers) or fail to be created (with a specific error message), if no matching server is available.

NOTE: Create calls without or with ''/'!' as meta_server-tag will only match untagged servers. So, for a frontend unaware of the feature, SL will behave as previously if a pool of untagged ("default") servers is maintained. It is recommended to always add your default servers as untagged servers.

Examples

Consider the following setup:
$ bundle exec rake status

HOSTNAME   STATE   STATUS  MEETINGS  USERS  LARGEST MEETING  VIDEOS  LOAD   BBB VERSION   TAG  
 bbb-1    enabled  online  1         2      2                0        3.0      3.0.0      test
 bbb-2    enabled  online  1         1      1                0        2.0      3.0.0
 bbb-3    enabled  online  0         0      0                0        0.0      3.0.0 
 bbb-4    enabled  online  1         1      1                0        2.0      3.0.0      test2

Now, consider the following examples of meta_server-tag parameters:

  • Passing meta_server-tag= or meta_server-tag=! or omitting the parameter altogether are all equivalent and will place the meeting on bbb-3 (least loaded untagged).
  • Passing meta_server-tag=test or meta_server-tag=test! will place the meeting on bbb-1 (the only match).
  • Passing meta_server-tag=test;test2 or meta_server-tag=test;test2! will place the meeting on bbb-4 (least loaded match).
  • Passing meta_server-tag=none or meta_server-tag=none! will place the meeting on bbb-3 ) (least loaded match).
  • Passing meta_server-tag=test3 will place the meeting on bbb-3 (fallback to least loaded untagged).
  • Passing meta_server-tag=test3! will place the meeting on bbb-3 (fallback to least loaded untagged).

Fixed issues

#1095

@Ithanil Ithanil marked this pull request as ready for review December 4, 2024 11:30
@Ithanil Ithanil changed the title Support for comma-separated list of tags on create calls [WIP] Support for comma-separated list of tags on create calls Dec 4, 2024
@Ithanil Ithanil changed the title Support for comma-separated list of tags on create calls Support for semicolon-separated list of tags on create calls Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant