Skip to content

Handle DELETE_OPERATION_TOO_LARGE exception #1026

Description

@manuerwin

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

v4.19.3

New Bug Summary

Periodically receive Apex unhandled exceptions during scheduled purge batch window that delete failed due to DELETE_OPERATION_TOO_LARGE, Cascade deleting too many records for both Feed Items and Log Entries.
The log records (and child log entries) are deleted by the time I review the unhandled exceptions.

IFF the eventual deletion of the parent logs is guaranteed, would be great to handle (WARN/ERROR log?) these currently unhandled exceptions.

Failed to process batch for class 'LogBatchPurger' for job id '707RF00001g1072'

caused by: System.DmlException: Delete failed. First exception on row 0 with id a1ERF000005r1EP2AY; first error: DELETE_OPERATION_TOO_LARGE, Cascade deleting too many records: occurring when cascading to Feed Item records: []

Class.LoggerDataStore.Database.deleteRecords: line 118, column 1
Class.LoggerDataStore.Database.hardDeleteRecords: line 148, column 1
Class.LogBatchPurger.execute: line 122, column 1
Class.LogBatchPurger.execute: line 105, column 1
Failed to process batch for class 'LogBatchPurger' for job id '707RF00001g1072'

caused by: System.DmlException: Delete failed. First exception on row 0 with id a1ERF000005sgZJ2AY; first error: DELETE_OPERATION_TOO_LARGE, Cascade deleting too many records: occurring when cascading to Log Entry records: []

Class.LoggerDataStore.Database.deleteRecords: line 118, column 1
Class.LoggerDataStore.Database.hardDeleteRecords: line 148, column 1
Class.LogBatchPurger.execute: line 122, column 1
Class.LogBatchPurger.execute: line 105, column 1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: Log RetentionItems related to LogBatchPurger or LogBatchPurgeSchedulerLayer: ConfigurationItems related to the custom hierarchy setting LoggerSettings__c or any included custom metadata typeType: BugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions