[
https://issues.apache.org/jira/browse/UNOMI-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18126623#comment-18126623
]
Serge Huber commented on UNOMI-1006:
------------------------------------
Pull request: https://github.com/apache/unomi/pull/916
{{scheduler.nodeId}} now defaults to the cluster node id
({{UNOMI_CLUSTER_NODEID}} / {{org.apache.unomi.cluster.nodeId}}). Optional
override: {{UNOMI_SCHEDULER_NODEID}}. The former shared default
{{test-scheduler-node}} is removed from the shipped config; if it is still
injected, startup logs a warning.
> All Unomi nodes share the same scheduler node id by default
> -----------------------------------------------------------
>
> Key: UNOMI-1006
> URL: https://issues.apache.org/jira/browse/UNOMI-1006
> Project: Apache Unomi
> Issue Type: Bug
> Affects Versions: unomi-4.0.0
> Reporter: Serge Huber
> Assignee: Serge Huber
> Priority: Critical
> Fix For: unomi-4.0.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> h3. Summary
> The new cluster scheduler uses a node id to know which node holds a task. By
> default every node uses the same id, "test-scheduler-node", and no
> environment variable lets you change it. Unlike the cluster node id, it must
> be changed by editing a configuration file.
> Two nodes that keep the default both think they own the same task, so a task
> that should run once can run on both.
> The goal of this ticket is that each node has its own scheduler id without
> extra work.
> h3. Ways to explore
> * Add an environment variable for the scheduler node id, as already exists
> for the cluster node id.
> * Default it to the cluster node id, or to a generated unique value.
> * Warn or refuse to start when two nodes use the same id.
> * Keep the lock owner check strict.
> h3. How to test
> Manual check: start two nodes with default settings. Check that they have
> different scheduler ids and that an exclusive task runs on only one node.
> Automated tests to add. Each must fail on the 4.0.0 release candidate and
> pass once the fix is in:
> * A unit test that two scheduler instances started with the default settings
> get different node ids, and that the environment variable is used when it is
> set.
> * A lock test: a lock held by one node cannot be taken by another node while
> it is valid.
> * A test that two nodes using the same id are detected (warning or refusal,
> as decided).
> * A cluster race test with two schedulers on default settings: an exclusive
> task runs exactly once per period.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)