Skip to content

Conversation

@developfast
Copy link

@developfast developfast commented Oct 28, 2025

What I did
Allow state db to take modified entries made to the tunnel decap table

Why I did it
Prevent DB inconsistency between state, asic and appl db

How I verified it
redis-cli -n 6 HGETALL "TUNNEL_DECAP_TABLE|IPINIP_V6_TUNNEL"

  1. "tunnel_type"
  2. "IPINIP"
  3. "dscp_mode"
  4. "pipe"
  5. "ecn_mode"
  6. "standard"
  7. "ttl_mode"
  8. "pipe"

/var/log/syslog.1:2025 Nov 10 19:18:32.730385 bjw-can-2700-2 NOTICE swss#orchagent: :- doDecapTunnelTask: Fields for TUNNEL_DECAP_TABLE entry 'IPINIP_TUNNEL' have been synchronised in STATE_DB
/var/log/syslog.1:2025 Nov 10 19:18:32.740298 bjw-can-2700-2 NOTICE swss#orchagent: :- doDecapTunnelTask: Fields for TUNNEL_DECAP_TABLE entry 'IPINIP_V6_TUNNEL' have been synchronised in STATE_DB

Added comprehensive unit tests too which pass

make  check-TESTS
make[1]: Entering directory '/home/devojha/data/sonic-swss/tests/mock_tests'
make[2]: Entering directory '/home/devojha/data/sonic-swss/tests/mock_tests'
PASS: tests
PASS: tests_intfmgrd
PASS: tests_teammgrd
PASS: tests_portsyncd
PASS: tests_fpmsyncd
PASS: tests_response_publisher
============================================================================
Testsuite summary for sonic-swss 1.0
============================================================================
# TOTAL: 6
# PASS:  6
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[2]: Leaving directory '/home/devojha/data/sonic-swss/tests/mock_tests'
make[1]: Leaving directory '/home/devojha/data/sonic-swss/tests/mock_tests'

Details if related

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@developfast developfast force-pushed the dev/tunnel-decap-mod-state-db branch from 3fe4837 to 93a087a Compare October 28, 2025 23:32
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@developfast developfast marked this pull request as ready for review November 14, 2025 04:37
@developfast developfast requested a review from prsunny as a code owner November 14, 2025 04:37
Copilot AI review requested due to automatic review settings November 14, 2025 04:37
Copilot finished reviewing on behalf of developfast November 14, 2025 04:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables synchronization of tunnel decap table modifications to STATE_DB, preventing database inconsistencies between STATE_DB, ASIC_DB, and APPL_DB. The implementation tracks field changes via a state_changed flag and publishes updates to STATE_DB when modifications occur to existing tunnel entries.

Key Changes

  • Added state_changed flag tracking in doDecapTunnelTask() to detect when tunnel fields are modified
  • Set the flag when modifiable fields (dscp_mode, ttl_mode, QoS maps) are updated on existing tunnels
  • Added STATE_DB synchronization call when changes are detected

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
orchagent/tunneldecaporch.cpp Implements state change tracking and STATE_DB synchronization for tunnel decap table modifications
tests/mock_tests/tunneldecaporch_ut.cpp Adds comprehensive unit tests for TunnelDecapOrch functionality including creation, modification, and deletion scenarios
tests/mock_tests/Makefile.am Registers the new tunneldecaporch_ut.cpp test file in the build system

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@developfast developfast force-pushed the dev/tunnel-decap-mod-state-db branch from 191dc36 to 03d3d78 Compare November 14, 2025 19:44
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@developfast
Copy link
Author

@kperumalbfn can you pls check why the checks won't run? The agents don't seem to be grabbing the workers before the 45 min timeout

@developfast
Copy link
Author

@prsunny @kperumalbfn can you pls review?

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

Successfully merging this pull request may close these issues.

2 participants