Menu

#2247 log: Log stream file is not reserved during si-swap

5.0.2
fixed
nobody
None
defect
log
d
major
2017-02-07
2016-12-28
Tai Dinh
No

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

Related

Tickets: #2247
Wiki: ChangeLog-5.0.2
Wiki: ChangeLog-5.1.1

Discussion

  • Canh Truong

    Canh Truong - 2016-12-28
    • summary: Log stream file is not reserved during si-swap --> log: Log stream file is not reserved during si-swap
     
  • Canh Truong

    Canh Truong - 2016-12-28
    • status: unassigned --> assigned
    • assigned_to: Canh Truong
     
  • Canh Truong

    Canh Truong - 2017-01-03
    • status: assigned --> review
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2017-02-07
    • status: review --> fixed
    • assigned_to: Canh Truong --> nobody
    • Milestone: 5.2.FC --> 5.0.2
     
  • Vu Minh Nguyen

    Vu Minh Nguyen - 2017-02-07

    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


Log in to post a comment.