Description
If a plugin uses TSStatFindName followed by TSStatCreate, TSStatFindName can return 0 for all the metric IDs after a traffic_server crash.
AFAICT this will happen every time with the following conditions:
1. traffic_manager has pulled the plugin stat records from traffic_server
2. traffic_server crashes
When traffic_server comes back up, it pulls the records from traffic_manager. traffic_manager sends the records including the rsb_id field. However, RecForceInsert() does not copy the rsb_id field from the message to the actual record. There are 2 reasonable fixes:
- We could not propagate the 'registered' flag for records that we on. This forces the code to re-register, which will bring the stats back to the correct state.
- We could ensure that we copy the rsb_id field so that stat lookups succeed.