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

multiple apps in libcluster, quantum does not identifies which node to select #605

Open
marinakr opened this issue Mar 5, 2024 · 2 comments

Comments

@marinakr
Copy link

marinakr commented Mar 5, 2024

Hi there, I have few applications running in cluster which able to call each other
Assume I have apps api-server, intergation-server
I have quantum used in app intergation-server
I have few nodes of api-server and few nodes intergation-server
in intergation-server config, I have settings in config

config :intergation-server, IntergationServer.Scheduler,
timeout: :infinity,
  overlap: false,
  global: true,
  jobs: [
  {"1 * * * *", ... } <- Every hour 
  ...
 ]

Nodes visible in :intergation-server:

Node.self
:"app@**.**.**.**1"
iex([email protected])7> Node.list
[
:"app@**.**.**.**2"  # <- node of :intergation-server
:"app@**-**-**-***.api.pod.cluster.local", # <- node of :api-server
 :"app@**-**-**-***.api.pod.cluster.local", # <- node of :api-server
 :"app@**-**-**-***.api.pod.cluster.local" # <- node of :api-server
 ]

I can see job (for application intergation-server) is triggering once in few hours, I assume nodes of another application (api-server) included in when Quantum.RunStrategy.Random select node to run

Node list gets all nodes available:
https://github.com/quantum-elixir/quantum-core/blob/main/lib/quantum/run_strategy/random.ex#L46

@maennchen
Copy link
Member

That is correct. We can’t differentiate the nodes.

If you have a good idea how to do that, please open a PR. Otherwise you‘ll have to implement a custom strategy for your project that chooses from the correct nodes.

Btw: The option global no longer exists.

@marinakr
Copy link
Author

marinakr commented Mar 5, 2024

I ll add PR (implemented custom strategy, will add PR in process how to do it in Random)
global should be removed from documentation in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants