[ 
https://issues.apache.org/jira/browse/TS-2931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14063095#comment-14063095
 ] 

ASF subversion and git services commented on TS-2931:
-----------------------------------------------------

Commit de2f11742c4e0ae1b4e5ee996dda204c2f59e289 in trafficserver's branch 
refs/heads/4.2.x from [[email protected]]
[ https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;h=de2f117 ]

TS-2931: plugin metrics fail after a crash

If a plugin uses TSStatFindName followed by TSStatCreate, TSStatFindName
can return 0 for all the metric IDs after a traffic_server crash.

This will happen every time with the following conditions:
  1. traffic_manager has pulled the 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. Subsequent stat lookups
succeed because the stat is registered, but always receive a rsb_id
of 0.

The fix is to ensure that we copy the rsb_id field so that stat
lookups succeed.

(cherry picked from commit d537357da69ee701c7165f0e1f07554e18324e1f)

Conflicts:
        CHANGES


> plugin metrics fail after a crash
> ---------------------------------
>
>                 Key: TS-2931
>                 URL: https://issues.apache.org/jira/browse/TS-2931
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Plugins, TS API
>            Reporter: James Peach
>            Assignee: James Peach
>             Fix For: 4.2.2, 5.1.0
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to