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

fix: remove failover flows upfront during redeploy #448

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

viniarck
Copy link
Member

@viniarck viniarck commented Mar 13, 2024

Closes #446

Summary

See updated changelog file

Local Tests

  • I didn't manage to reproduce the original issue but I tested the following cases:
  • Confirmed that after a redeploy it clean up the failover flows
  • Confirmed that after a redeploy if there has been a link status change it would still respect the timer to compute a new failover_path
kytos $> 2024-03-13 17:13:28,428 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:02, command: delete, force: True,  flo
ws[0, 1]: [{'cookie': 12252344641096843340, 'cookie_mask': 18446744073709551615}]
2024-03-13 17:13:28,436 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42472 - "POST /api/kytos/flow_manager/v2/delete/00%3A00%3A00%3A00%3A00%3A00%3A00%3A02 HTTP/1.1" 202
2024-03-13 17:13:28,448 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:03, command: delete, force: True,  flows[0, 1]:
 [{'cookie': 12252344641096843340, 'cookie_mask': 18446744073709551615}]
2024-03-13 17:13:28,454 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42486 - "POST /api/kytos/flow_manager/v2/delete/00%3A00%3A00%3A00%3A00%3A00%3A00%3A03 HTTP/1.1" 202
2024-03-13 17:13:28,460 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:01, command: delete, force: True,  flows[0, 1]:
 [{'cookie': 12252344641096843340, 'cookie_mask': 18446744073709551615}]
2024-03-13 17:13:28,466 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42500 - "POST /api/kytos/flow_manager/v2/delete/00%3A00%3A00%3A00%3A00%3A00%3A00%3A01 HTTP/1.1" 202
2024-03-13 17:13:28,475 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:03, command: delete, force: True,  flows[0, 1]:
 [{'cookie': 12252344641096843340, 'cookie_mask': 18446744073709551615}]
2024-03-13 17:13:28,477 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42508 - "POST /api/kytos/flow_manager/v2/delete/00%3A00%3A00%3A00%3A00%3A00%3A00%3A03 HTTP/1.1" 202
2024-03-13 17:13:28,482 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:01, command: delete, force: True,  flows[0, 1]:
 [{'cookie': 12252344641096843340, 'cookie_mask': 18446744073709551615}]
2024-03-13 17:13:28,484 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42510 - "POST /api/kytos/flow_manager/v2/delete/00%3A00%3A00%3A00%3A00%3A00%3A00%3A01 HTTP/1.1" 202
2024-03-13 17:13:28,492 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42524 - "POST /api/kytos/pathfinder/v3/ HTTP/1.1" 200
2024-03-13 17:13:28,497 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:01, command: add, force: False,  flows[0, 2]: [
{'match': {'in_port': 1, 'dl_vlan': 2222}, 'cookie': 12252344641096843340, 'actions': [{'action_type': 'push_vlan', 'tag_type': 's'}, {'action_type': 'set_vlan', 'vlan_id': 1}, {'action_
type': 'output', 'port': 4}], 'owner': 'mef_eline', 'table_group': 'evpl', 'table_id': 0, 'priority': 20000}, {'match': {'in_port': 4, 'dl_vlan': 1}, 'cookie': 12252344641096843340, 'act
ions': [{'action_type': 'pop_vlan'}, {'action_type': 'output', 'port': 1}], 'owner': 'mef_eline', 'table_group': 'evpl', 'table_id': 0, 'priority': 20000}]
2024-03-13 17:13:28,503 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42526 - "POST /api/kytos/flow_manager/v2/flows/00%3A00%3A00%3A00%3A00%3A00%3A00%3A01 HTTP/1.1" 202
2024-03-13 17:13:28,510 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:03, command: add, force: False,  flows[0, 2]: [
{'match': {'in_port': 1, 'dl_vlan': 2222}, 'cookie': 12252344641096843340, 'actions': [{'action_type': 'push_vlan', 'tag_type': 's'}, {'action_type': 'set_vlan', 'vlan_id': 1}, {'action_
type': 'output', 'port': 3}], 'owner': 'mef_eline', 'table_group': 'evpl', 'table_id': 0, 'priority': 20000}, {'match': {'in_port': 3, 'dl_vlan': 1}, 'cookie': 12252344641096843340, 'act
ions': [{'action_type': 'pop_vlan'}, {'action_type': 'output', 'port': 1}], 'owner': 'mef_eline', 'table_group': 'evpl', 'table_id': 0, 'priority': 20000}]
2024-03-13 17:13:28,520 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42540 - "POST /api/kytos/flow_manager/v2/flows/00%3A00%3A00%3A00%3A00%3A00%3A00%3A03 HTTP/1.1" 202
2024-03-13 17:13:28,524 - INFO [kytos.napps.kytos/mef_eline] (AnyIO worker thread) EVC(0912890e3d004c, inter_evpl) was deployed.
2024-03-13 17:13:28,525 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42466 - "PATCH /api/kytos/mef_eline/v2/evc/0912890e3d004c/redeploy HTTP/1.1" 202
2024-03-13 17:13:28,530 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42542 - "POST /api/kytos/pathfinder/v3/ HTTP/1.1" 200
2024-03-13 17:13:28,543 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:02, command: add, force: False,  flows[0, 2]: [
{'match': {'in_port': 2, 'dl_vlan': 1}, 'cookie': 12252344641096843340, 'actions': [{'action_type': 'set_vlan', 'vlan_id': 1}, {'action_type': 'output', 'port': 3}], 'owner': 'mef_eline'
, 'table_group': 'evpl', 'table_id': 0, 'priority': 20000}, {'match': {'in_port': 3, 'dl_vlan': 1}, 'cookie': 12252344641096843340, 'actions': [{'action_type': 'set_vlan', 'vlan_id': 1},
 {'action_type': 'output', 'port': 2}], 'owner': 'mef_eline', 'table_group': 'evpl', 'table_id': 0, 'priority': 20000}]
2024-03-13 17:13:28,550 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42544 - "POST /api/kytos/flow_manager/v2/flows/00%3A00%3A00%3A00%3A00%3A00%3A00%3A02 HTTP/1.1" 202
2024-03-13 17:13:28,558 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:01, command: add, force: False,  flows[0, 1]: [
{'match': {'in_port': 3, 'dl_vlan': 1}, 'cookie': 12252344641096843340, 'actions': [{'action_type': 'pop_vlan'}, {'action_type': 'output', 'port': 1}], 'owner': 'mef_eline', 'table_group
': 'evpl', 'table_id': 0, 'priority': 20000}]
2024-03-13 17:13:28,564 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42558 - "POST /api/kytos/flow_manager/v2/flows/00%3A00%3A00%3A00%3A00%3A00%3A00%3A01 HTTP/1.1" 202
2024-03-13 17:13:28,571 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:03, command: add, force: False,  flows[0, 1]: [
{'match': {'in_port': 2, 'dl_vlan': 1}, 'cookie': 12252344641096843340, 'actions': [{'action_type': 'pop_vlan'}, {'action_type': 'output', 'port': 1}], 'owner': 'mef_eline', 'table_group
': 'evpl', 'table_id': 0, 'priority': 20000}]
2024-03-13 17:13:28,576 - INFO [uvicorn.access] (MainThread) 127.0.0.1:42572 - "POST /api/kytos/flow_manager/v2/flows/00%3A00%3A00%3A00%3A00%3A00%3A00%3A03 HTTP/1.1" 202
2024-03-13 17:13:28,584 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_app_10) Failover path for EVC(0912890e3d004c, inter_evpl) was deployed.

End-to-End Tests

e2e exec with this branch:

+ python3 scripts/wait_for_mongo.py
Trying to run hello command on MongoDB...
Trying to run 'hello' command on MongoDB...
Ran 'hello' command on MongoDB successfully. It's ready!
+ python3 -m pytest tests/ --reruns 2 -r fEr
============================= test session starts ==============================
platform linux -- Python 3.9.2, pytest-7.2.0, pluggy-1.4.0
rootdir: /builds/amlight/kytos-end-to-end-tester/kytos-end-to-end-tests
plugins: rerunfailures-10.2, timeout-2.1.0, anyio-3.6.2
collected 261 items
tests/test_e2e_01_kytos_startup.py ..                                    [  0%]
tests/test_e2e_05_topology.py ....................                       [  8%]
tests/test_e2e_10_mef_eline.py ..........ss.....x.....x................  [ 23%]
tests/test_e2e_11_mef_eline.py ......                                    [ 26%]
tests/test_e2e_12_mef_eline.py .....Xx.                                  [ 29%]
tests/test_e2e_13_mef_eline.py ....Xs.s.....Xs.s.XXxX.xxxx..X........... [ 44%]
.                                                                        [ 45%]
tests/test_e2e_14_mef_eline.py x                                         [ 45%]
tests/test_e2e_15_mef_eline.py .....                                     [ 47%]
tests/test_e2e_16_mef_eline.py .                                         [ 47%]
tests/test_e2e_20_flow_manager.py .....................                  [ 55%]
tests/test_e2e_21_flow_manager.py ...                                    [ 57%]
tests/test_e2e_22_flow_manager.py ...............                        [ 62%]
tests/test_e2e_23_flow_manager.py ..............                         [ 68%]
tests/test_e2e_30_of_lldp.py ....                                        [ 69%]
tests/test_e2e_31_of_lldp.py ...                                         [ 70%]
tests/test_e2e_32_of_lldp.py ...                                         [ 72%]
tests/test_e2e_40_sdntrace.py ..............                             [ 77%]
tests/test_e2e_41_kytos_auth.py ........                                 [ 80%]
tests/test_e2e_42_sdntrace.py ..                                         [ 81%]
tests/test_e2e_50_maintenance.py ............................            [ 91%]
tests/test_e2e_60_of_multi_table.py .....                                [ 93%]
tests/test_e2e_70_kytos_stats.py ........                                [ 96%]
tests/test_e2e_80_pathfinder.py ss......                                 [100%]
=============================== warnings summary ===============================
------------------------------- start/stop times -------------------------------
= 237 passed, 8 skipped, 9 xfailed, 7 xpassed, 1143 warnings in 13406.06s (3:43:26) =

@viniarck viniarck requested a review from a team as a code owner March 13, 2024 20:31
Copy link

@italovalcy italovalcy left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for fixing this, @viniarck

@viniarck
Copy link
Member Author

LGTM! Thanks for fixing this, @viniarck

Appreciated your review @italovalcy, and thanks also for finding this issue.

@viniarck viniarck merged commit 06f53e5 into master Mar 15, 2024
2 checks passed
@viniarck viniarck deleted the fix/failover_redeploy_cleanup branch March 15, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants