Skip to content

Commit

Permalink
Fix the tlm_teamd deleting STATE_DB LAG_TABLE entry.
Browse files Browse the repository at this point in the history
What I did:
Fixes:
sonic-net/sonic-buildimage#20059

Why I did:
On T2 testbed with multiple backend port channel we have seen sometime Portchannel gets created fine and with entry in APP_DB and STATE_DB gets populated. tlm_teamd is able to get the teamdctl handle to get state dump view of teamd. However while getting dump if might have passed in 1st iteration but it might fail in 2nd iteration (transient issue in getting data using teamdctl) which result in deletion of State db entry which is not correct. Instead we should just clean up local cache and wait for retry done as part of Select Timeout cycle where we try to get dump again.
  • Loading branch information
abdosi authored Oct 24, 2024
1 parent bd945f6 commit 064f2e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tlm_teamd/values_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,13 @@ void ValuesStore::update(const std::vector<StringPair> & dumps)
{
const auto & storage = from_json(dumps);
const auto & old_keys = get_old_keys(storage);
remove_keys_db(old_keys);
// Do not delete te key from State Db. State DB LAB_TABLE entry is created/deleted
// from teamsyncd on detecting netlink of teamd dev as up/down. For some reason
// if we do not get state dump from teamdctl it might be transient issue. If it is
// persistent issue then teamsyncd might be able to catch it and delete state db entry
// or we can keep entry in it's current state as best effort. Similar to try_add_lag which is best effort
// to connect to teamdctl and if it fails we do not delete State Db entry.
//remove_keys_db(old_keys);
remove_keys_storage(old_keys);
const auto & keys_to_refresh = update_storage(storage);
update_db(storage, keys_to_refresh);
Expand Down

0 comments on commit 064f2e3

Please sign in to comment.