- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2023 07:09 AM
Just seeking clarification and advice on the following:
When certain modifications are made to incident records in the incident table, some records in my custom staging table are created. I have created a scheduled job that will search the staging table for unprocessed records and then begin processing those. This job will run every 30 minutes. As ServiceNow instances operate in a clustered fashion, one of my worries is whether it's possible for many instances to trigger the same scheduled job at the same time and attempt to change the same data. If this is the case, how can this be avoided?
Thank You
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2023 07:27 AM
Hi,
Scheduled jobs are assigned to one 'worker thread' on one application node. To prevent the situation you are concerned with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2023 12:10 PM
Hi @pratapdalai
A ServiceNow instance is made up of several application and database servers or nodes. These generally run on shared hardware, meaning although your instance is logically separate and independent, it is physically hosted alongside another customer. At each location, there are generally at least two application nodes, each running a copy of the ServiceNow platform and working together to share load.
Additionally, there may be worker nodes installed to process the noninteractive jobs, such as sending out e-mails or dealing with integrations. Even though you'll never directly log in to these worker nodes, they perform some background processing, allowing the interactive application servers to respond more quickly to user requests. While there are generally lots of application nodes, there is only one active database server, running on a separate physical server.
In a ServiceNow instance running in a clustered environment, where multiple nodes are involved, the platform ensures that only one node executes a specific scheduled job at a time. This behavior is achieved through the cluster-awareness functionality built into ServiceNow.
When a scheduled job is created in ServiceNow, the platform uses the cluster-awareness feature to coordinate the execution of the job across the nodes. The platform ensures that only one node is responsible for executing the scheduled job, while the other nodes ignore it.
The cluster-awareness feature utilizes distributed locking mechanisms to ensure that only one node acquires the lock and executes the scheduled job. This mechanism prevents multiple nodes from picking up the same job simultaneously.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2023 07:27 AM
Hi,
Scheduled jobs are assigned to one 'worker thread' on one application node. To prevent the situation you are concerned with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2023 12:10 PM
Hi @pratapdalai
A ServiceNow instance is made up of several application and database servers or nodes. These generally run on shared hardware, meaning although your instance is logically separate and independent, it is physically hosted alongside another customer. At each location, there are generally at least two application nodes, each running a copy of the ServiceNow platform and working together to share load.
Additionally, there may be worker nodes installed to process the noninteractive jobs, such as sending out e-mails or dealing with integrations. Even though you'll never directly log in to these worker nodes, they perform some background processing, allowing the interactive application servers to respond more quickly to user requests. While there are generally lots of application nodes, there is only one active database server, running on a separate physical server.
In a ServiceNow instance running in a clustered environment, where multiple nodes are involved, the platform ensures that only one node executes a specific scheduled job at a time. This behavior is achieved through the cluster-awareness functionality built into ServiceNow.
When a scheduled job is created in ServiceNow, the platform uses the cluster-awareness feature to coordinate the execution of the job across the nodes. The platform ensures that only one node is responsible for executing the scheduled job, while the other nodes ignore it.
The cluster-awareness feature utilizes distributed locking mechanisms to ensure that only one node acquires the lock and executes the scheduled job. This mechanism prevents multiple nodes from picking up the same job simultaneously.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 03:12 AM
Hi @Manmohan K , is this applicable to on-premise SN platforms too? or do we need to define anything specifically for this purpose?
Thanks,
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 07:17 AM
There is documentation, knowledge articles available to customers on self-hosting their instance. Create a Support Case if you can' find that. And yes, the system scheduler works the same on hosted and self-hosted instances.