Normally, when a trigger reaches its end time, quartz automatically deletes the entry from the qrtz_triggers table.
However, when I set the misfire instruction to MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT, the entry in the qrtz_triggers table is marked with COMPLETED state with next_fire_time=-1. The entry is not removed from the table by quartz.
Question:
1. Why is the trigger in the above misfired case not deleted from the table by quartz?
2. Is there any api method can be used to delete such entry?
There are a few corner cases (depending upon processing scenarios) where Quartz marks a trigger "complete" rather than just deleting it, and misfire handling is one of them.
Quartz deletes all "complete" triggers upon startup of the scheduler. So if your application doesn't "bounce" for some time, there may be a collection of triggers in complete state.