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

Inconsistent Sum Behaviour On CMDT Grandparent Full Recalculate rollup #616

Open
jaredcloudyknights opened this issue Aug 15, 2024 · 8 comments

Comments

@jaredcloudyknights
Copy link

jaredcloudyknights commented Aug 15, 2024

Hi,

I've noticed some inconsistent behaviour regarding the Grandparent rollup when using the Full Recalculate button or when an update is triggered by a batch job. The rollup to the parent works fine but the grandparent will sometimes double or half the value that should be there. Interestingly, re-running the recalculate will often resolve the incorrect amounts (but sometimes cause other records to become incorrect).

For context in the loom/screenshots: Revenue_Booked__c records are created by a batch job which then triggers two rollups defined by two CMDT to two records, a parent (Credit_Line__c) & a grandparent (Loan__c). This behaviour can also be intermittently observed on using the full batch recalculate via the "Recalculate Rollup" page. I've checked and all objects have the rollup trigger setup correctly (otherwise nothing would work I imagine).

Loom Explainer here

Details about the two CMDT records in question:

  1. Revenue_Booked__c -> Credit_Line__c (Parent)
    image
  2. Revenue_Booked__c -> Loan__c (Grandparent)
    image

I've also got Nebula Logger installed in my test org, but can't make heads or tails of what the cause may be & I can regularly replicate the issue.

Version number: 1.6.32
image

Let me know if any more detail is required. Also fully recognise that it could be something to do with how my rollups are set up. 😄

EDIT: I've been trying to do my own debugging and playing around with batch sizes. I've noted that changing the batch chunk size causes the issue to amplify/exacerbate wildly.
Batch Settings
image

Cross-Check Report results (over 50% of records are now affected)
image

@jamessimone
Copy link
Owner

Hello, and thanks for submitting this! I will take a look, but I won't be able to begin investigating till next week. Just wanted to keep you informed as to the timeline; I'll follow up here next week with questions.

@jaredcloudyknights
Copy link
Author

No worries, thanks @jamessimone, completely understand. And thanks for all your hard work on this!

@jamessimone
Copy link
Owner

@jaredcloudyknights apologies for the delay in response - I've finally had the chance to start looking into this issue and thanks to the wonderful video you recorded and the details you've shared here, I believe I've pinpointed the problem. I'm going to do my best to get the fix out with the next version, which I hope to release today

jamessimone added a commit that referenced this issue Aug 22, 2024
* Updates prettier dependencies

* Tentatively fixes MONTH-based literals for non-US based locales. Needs a bit of cleanup, but will do the trick for now

* Housekeeping on cached RollupRelationshipFieldFinder.Traversal while investigating #616
@jamessimone
Copy link
Owner

@jaredcloudyknights if you're able to test on the new version, let me know! I made some changes that may help.

@jaredcloudyknights
Copy link
Author

jaredcloudyknights commented Aug 29, 2024

@jamessimone sorry just had a chance to update the package and retest. Unfortunately, it looks to still be occurring. I've recorded another Loom here stepping through the reproduction of the issue.

image

@jamessimone
Copy link
Owner

Not to worry. I am continuing to look into this - apologies that it's been slow going

@jamessimone
Copy link
Owner

It's my belief that this issue and #615 are related, and I'm continuing to work on a resolution for both

@jaredcloudyknights
Copy link
Author

Thanks @jamessimone for the update

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

No branches or pull requests

2 participants