From bf032e15867b74e1a1164092072a093aa0fa72f4 Mon Sep 17 00:00:00 2001 From: rajkumar1 Date: Sun, 24 Aug 2025 07:09:16 +0000 Subject: [PATCH 1/2] dummy commit to check unrelated failures --- orchagent/flex_counter/flex_counter_manager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/orchagent/flex_counter/flex_counter_manager.h b/orchagent/flex_counter/flex_counter_manager.h index 2724a69aed2..54091d06d1d 100644 --- a/orchagent/flex_counter/flex_counter_manager.h +++ b/orchagent/flex_counter/flex_counter_manager.h @@ -180,6 +180,7 @@ struct CachedObjects auto counter_ids = FlexCounterManager::serializeCounterStats(pending_counter_stats); auto counter_type_it = FlexCounterManager::counter_id_field_lookup.find(pending_counter_type); + // dummy comment auto counter_keys = group_name + ":"; for (const auto& oid: pending_sai_objects) { From 8ee7decc8c98f343402195ea7b574969d69ebe45 Mon Sep 17 00:00:00 2001 From: Sonic Build Admin Date: Tue, 2 Sep 2025 00:33:33 +0000 Subject: [PATCH 2/2] [Mux] Clear bulkers when rolling back mux switchover **What I did** When a switchover failure is detected in MuxOrch, clear relevant bulkers to provide a clean slate for the rollback process. **Why I did it** In certain failure scenarios, if an exception is thrown inside the bulker, it's possible that the bulker is not cleared and still contains data in `creating_entries` or `removing_entries`. When the rollback process begins, these entries will be programmed to the SAI a second time, which is a) incorrect b) could potentially trigger the same exception second time. **How I verified it** Run the `MuxRollbackTest.StandbyToActiveExceptionRollbackToStandby` test **Details if related** --- orchagent/muxorch.cpp | 4 ++++ orchagent/muxorch.h | 1 + orchagent/neighorch.cpp | 6 ++++++ orchagent/neighorch.h | 2 ++ tests/mock_tests/Makefile.am | 3 +++ 5 files changed, 16 insertions(+) diff --git a/orchagent/muxorch.cpp b/orchagent/muxorch.cpp index 8d7a66e98ea..2df598c48b1 100644 --- a/orchagent/muxorch.cpp +++ b/orchagent/muxorch.cpp @@ -553,6 +553,10 @@ void MuxCable::rollbackStateChange() st_chg_in_progress_ = true; state_ = prev_state_; bool success = false; + + nbr_handler_->clearBulkers(); + gNeighOrch->clearBulkers(); + switch (prev_state_) { case MuxState::MUX_STATE_ACTIVE: diff --git a/orchagent/muxorch.h b/orchagent/muxorch.h index 4fc098bb48b..d0e8cd4f16c 100644 --- a/orchagent/muxorch.h +++ b/orchagent/muxorch.h @@ -94,6 +94,7 @@ class MuxNbrHandler sai_object_id_t getNextHopId(const NextHopKey); MuxNeighbor getNeighbors() const { return neighbors_; }; string getAlias() const { return alias_; }; + void clearBulkers() { gRouteBulker.clear(); }; private: bool removeRoutes(std::list& bulk_ctx_list); diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index ca7f834f643..934277027b4 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -2401,3 +2401,9 @@ bool NeighOrch::ifChangeInformRemoteNextHop(const string &alias, bool if_up) } return rc; } + +void NeighOrch::clearBulkers() +{ + gNeighBulker.clear(); + gNextHopBulker.clear(); +} diff --git a/orchagent/neighorch.h b/orchagent/neighorch.h index 1ba2ead688b..7d5e639d392 100644 --- a/orchagent/neighorch.h +++ b/orchagent/neighorch.h @@ -110,6 +110,8 @@ class NeighOrch : public Orch, public Subject, public Observer void updateSrv6Nexthop(const NextHopKey &, const sai_object_id_t &); bool ifChangeInformRemoteNextHop(const string &, bool); + void clearBulkers(); + private: PortsOrch *m_portsOrch; IntfsOrch *m_intfsOrch; diff --git a/tests/mock_tests/Makefile.am b/tests/mock_tests/Makefile.am index 2fa7ea06f97..4450bbc118e 100644 --- a/tests/mock_tests/Makefile.am +++ b/tests/mock_tests/Makefile.am @@ -4,6 +4,9 @@ P4_ORCH_DIR = $(top_srcdir)/orchagent/p4orch DASH_ORCH_DIR = $(top_srcdir)/orchagent/dash DASH_PROTO_DIR = $(top_srcdir)/orchagent/dash/proto +CFLAGS = -g -O0 +CXXFLAGS = -g -O0 + CFLAGS_SAI = -I /usr/include/sai TESTS = tests tests_intfmgrd tests_teammgrd tests_portsyncd tests_fpmsyncd tests_response_publisher