In resourceManager log, I found amount of log like below:
When I search this, I found the application has already log aggerated. When I debug this, I found the app's logAggregationStatusForAppReport is NOT_START. (Note: In my test cluster, I simulate restart rm occasionally)
If the application is finished and log aggerated, but not removed from rm. When rm failover, the new rm will recover from state store (you know log aggregation is not stored, so can't remove it), but logAggregationStatusForAppReport will not be updated. So logAggregationStatusForAppReport keep NOT_START. Then the app will not be removed from statestore.