Fix rollup failure for delayed metrics bug, by making changes in rollup state management
Add tests for the new rollup state management