jamessimone / apex-rollup

Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.
MIT License
220 stars 30 forks source link

Async jobs triggered when the Rollup Control Setting is set to run Synchronously #618

Closed kechetino closed 1 month ago

kechetino commented 2 months ago

Hi,

I set my Org Default Rollup Control (Which I am using for all my rollups) to run synchronously but whenever the child records are updated/inserted, it seems the RollupAsyncProcessor or the RollupFullBatchRecalculator is always triggered. Is this the expected behaviour or these jobs should not be running if the Control Setting is set to synchronous?

image image

jamessimone commented 2 months ago

@kechetino do you have any more info? The only thing I can think of, off-hand, is that there are some checks done prior to running a rollup synchronously which may be preventing a sync rollup from occurring. This can occur when your sync insert also triggers an update or delete on that same object. This forces the second rollup (the update/delete) to be run asynchronously to ensure that the parent-level information in the database is shown correctly for field-level history purposes.

kechetino commented 2 months ago

@jamessimone We are in the process of transitioning from DLRS to Apex Rollup so we still have some active DLRS rollups that are triggered by the same child records and updates the same parent. Could that be an issue?

jamessimone commented 2 months ago

It's certainly possible. Migrating users have reported strange behavior previously when Apex Rollup and DLRS are both triggered from the same child object, but I don't think there would be issues if it were just the same parents being updated from different children objects

kechetino commented 1 month ago

Thanks @jamessimone - Will give it a proper test when fully migrated and see if the issue persists.