The fix for #2215 introduce a change in log_stream_open_fileinit(). i.e:
- if (stream->numOpeners == 0) {
+ if ((stream->numOpeners == 0) || (*stream->p_fd == -1)) {
This will cause an unexpected behaviour during switchover, I guess.
The reason of it is because numOpeners will be checkpointed between the activate and the standby one meanwhile p_fd is node locally.
At starting up, both ACTIVE and STANDBY will have numOpeners and p_fd set to 0 and -1 accordingly.
After that, ACTIVE open the stream, increase the numOpeners and sync this value to standby. Also p_fd on ACTIVE will be set to the opened file but this value is not checked point to standby.
During switchover, the p_fd of standby will always equal to -1, this cause the stream filename will always be changed.
This can be easily reproduce by
- create an application stream
- saflogger to write some messages to it
- trigger an si-swap on OpenSAF SI.
- write another log to above application stream.
- Check that the stream filename has been rotated.
/Tai
changeset: 8559:cf55b10ad97d
tag: tip
parent: 8554:282c0a6e6d8f
user: Canh Van Truong canh.v.truong@dektech.com.au
date: Mon Jan 09 18:25:23 2017 +0700
summary: log: fix log file is changed during si-swap [#2247]
changeset: 8558:3ed15e1b89f9
branch: opensaf-5.1.x
parent: 8555:ab8689bfc0ba
user: Canh Van Truong canh.v.truong@dektech.com.au
date: Fri Dec 30 05:11:55 2016 +0700
summary: log: fix log file is changed during si-swap [#2247]
changeset: 8557:496e112e0515
branch: opensaf-5.0.x
user: Canh Van Truong canh.v.truong@dektech.com.au
date: Tue Feb 07 11:22:58 2017 +0700
summary: log: fix log file is changed during si-swap [#2247]
Related
Tickets:
#2247