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

Org Telemetry Fixes #3782

Conversation

force2b
Copy link
Contributor

@force2b force2b commented Nov 3, 2018

Fix two issues:

  • Integer Telemetry data was returning -1 for orgs that had no records to return. The intent is for -1 to represent an error querying data as opposed no data to query. The root issue here was that queries that returned 0 records would not return 0 for the telemetry, instead leaving the default value of -1.
  • Very large organization were still getting Query Timeout errors in the UTIL_OrgTelemetry_SObject_BATCH job after push upgrades. This PR changes the query to remove the non-selective filter against the Opportunity object. Significant query tests were done in to determine what query can run against a very very large organization without timing out. The initial query tests used two different WHERE clauses against the npe03__Recurring_Donation__c field. Both of those consistently failed with a query timeout error. The only query that did run consistently is one without any filter at all. Technically we could use a filter with against an indexed field, however in this case the goal was to use " != null" which would not use the index. As a result this job will query and loop through all Opportunity records, but just count the recurring donation related ones. Tests show that even with 16M Opportunities, this batch job will complete in under two hours (and is read-only, without any DML on any objects).

Critical Changes

Changes

Issues Closed

New Metadata

Deleted Metadata

force2b and others added 11 commits October 31, 2018 09:32
…tureParamter in the event of a query error as opposed to when the value should actually be zero.
…uery can run against a very very large organization without timing out. The initial query tests used two different WHERE clauses against the npe03__Recurring_Donation__c field. Both of those consistently failed with a query timeout error. The only query that did run consistently is one without any filter at all. Technically we could use a filter with against an indexed field, however in this case the goal was to use " != null" which would not use the index. As a result this job will query and loop through all Opportunity records, but just count the recurring donation related ones.
@force2b
Copy link
Contributor Author

force2b commented Nov 3, 2018

**lurch: attach W-029397
**lurch: attach W-029509

@LurchTheButler
Copy link

Tracking W-029397

@force2b
Copy link
Contributor Author

force2b commented Nov 3, 2018

**lurch: attach W-029509

@LurchTheButler
Copy link

Tracking W-029509

Copy link
Contributor

@RadSFDeveloper RadSFDeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the through analysis of the changes @force2b !

@force2b
Copy link
Contributor Author

force2b commented Nov 5, 2018

Thank you @RadSFDeveloper!

@force2b
Copy link
Contributor Author

force2b commented Nov 5, 2018

Free to merge after the builds are done.

@RadSFDeveloper RadSFDeveloper merged commit 60465f8 into master Nov 5, 2018
@RadSFDeveloper RadSFDeveloper deleted the feature/msmith/org-telemetry-returns-neg1-instead-of-zero branch November 5, 2018 20:07
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

Successfully merging this pull request may close these issues.

None yet

4 participants