fix metrics compacting

* in some occasions the object can be missing in redis
* metrics compacting did not expect nil objects
* cleanup the missing object from the index