Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[teamsyncd] The TeamSync::addLag method does not update field "oper_status" of LAG_TABLE in state_db #3192

Open
super-jiying opened this issue Jun 12, 2024 · 0 comments

Comments

@super-jiying
Copy link
Contributor

super-jiying commented Jun 12, 2024

Description:

TeamSync::addLag method only updates "admin_status" and "mtu" field to m_stateLagTable.

    bool lag_update = true;
    /* Return when the team instance has already been tracked */
    if (m_teamSelectables.find(lagName) != m_teamSelectables.end())
    {
        auto tsync = m_teamSelectables[lagName];
        if (tsync->admin_state == admin_state && tsync->mtu == mtu)
            return;
        tsync->admin_state = admin_state;
        tsync->mtu = mtu;
        lag_update = false;
    }

    FieldValueTuple s("state", "ok");
    fvVector.push_back(s);
    if (m_warmstart)
    {
        m_stateLagTablePreserved[lagName] = fvVector;
    }
    else
    {
        m_stateLagTable.set(lagName, fvVector);
    }

This will result in the "oper_status" value of LAG_TABLE in state_db remaining unchanged.

Steps to reproduce the issue:

  1. config portchannel
  2. config portchannel member

Describe the results you received:

In appl_db,"oper_status" is "up".

127.0.0.1:6379> hgetall LAG_TABLE:PortChannel0101
1) "mtu"
2) "9216"
3) "admin_status"
4) "up"
5) "oper_status"
6) "up"

In state_db,"oper_status" is "down".

127.0.0.1:6379[6]> hgetall LAG_TABLE|PortChannel0101
 1) "admin_status"
 2) "up"
 3) "oper_status"
 4) "down"
 5) "mtu"
 6) "9216"
 7) "state"
 8) "ok"
 9) "team_device.ifinfo.ifindex"
10) "14"
11) "team_device.ifinfo.dev_addr"
12) "74:fe:48:7b:29:3e"
13) "runner.fast_rate"
14) "false"
15) "runner.fallback"
16) "false"
17) "runner.active"
18) "true"
19) "setup.pid"
20) "33"
21) "setup.kernel_team_mode_name"
22) "loadbalance"

Describe the results you expected:

The "oper_status" of LAG_TABLE in state_db keeps consistent with with it in appl_db.

prsunny pushed a commit that referenced this issue Jun 25, 2024
What I did
Update oper_status of LAG_TABLE in state_db (#3195) - Fix for #3192

How I did it
In teamSync::addLag method, update lag "oper_status" status in state_db.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant