futurewei-cloud / alcor

Alcor: Cloud native SDN platform powered by Kubernetes and Istio
MIT License
32 stars 33 forks source link

Fix race condition for subnet, port and ip APIs #685

Closed DavidLiu506 closed 2 years ago

DavidLiu506 commented 3 years ago
  1. Transaction not work in port manager, multiple port manager service read same data and it cause data replace back.

    Example portmanager1 delete port1 and portmanager2 delete port2: 1) portmanager1 and portmanager2 read same data port1 port2 and port3 2) portmanager1 contains port2 and port3 after deletion. 3) portmanager2 contains port1 and port3 after deletion. 4) portmanager1 put back port2 and port3, database contains port2 and port3. 5) portmanager2 put back port1 and port3, database contains port1 and port3. After deletion, port1 not be deleted.

  2. Cache lock not ordered in private ip manager. Example: Transaction1: First request ipAddrRangeCache lock then request vpcIpRangeCache lock.
    Transaction2: Frist request vpcIpRangeCache lock then request ipAddrRangeCache lock.

  3. Dynamic lock can not created in private ip manager. update private ip manager data storage structure. Remove dynamic cache and put ips in subnet to IpAddrRange entity. then put IpAddrRange in to ipAddrRangeCache static cache.

lgtm-com[bot] commented 3 years ago

This pull request introduces 3 alerts when merging 7e8a8592b07dbe9f37b1a82b2a247ea5a1f83ccc into b4a4288a9a452cd17652a91119021afcd9bcbd7c - view on LGTM.com

new alerts:

lgtm-com[bot] commented 3 years ago

This pull request introduces 3 alerts when merging c3745439dc450bd91504c5a1daa35d1f6df19e79 into b4a4288a9a452cd17652a91119021afcd9bcbd7c - view on LGTM.com

new alerts:

lgtm-com[bot] commented 3 years ago

This pull request introduces 3 alerts when merging 8471f7189b00cebfa321f33cd15b561f4861f262 into b4a4288a9a452cd17652a91119021afcd9bcbd7c - view on LGTM.com

new alerts:

lgtm-com[bot] commented 3 years ago

This pull request introduces 6 alerts when merging a1fa9d91a64ac60562abac5990a5915bd635335e into b4a4288a9a452cd17652a91119021afcd9bcbd7c - view on LGTM.com

new alerts:

xieus commented 3 years ago

@DavidLiu506 Need some traction on this PR.