[
https://issues.apache.org/jira/browse/CLOUDSTACK-8616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14626606#comment-14626606
]
ASF GitHub Bot commented on CLOUDSTACK-8616:
--------------------------------------------
Github user wilderrodrigues commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/587#discussion_r34588816
--- Diff: systemvm/patches/debian/config/opt/cloud/bin/cs/CsFile.py ---
@@ -35,10 +35,9 @@ def load(self):
self.new_config.append(line)
except IOError:
logging.debug("File %s does not exist" % self.filename)
- return
else:
logging.debug("Reading file %s" % self.filename)
- self.config = copy.deepcopy(self.new_config)
+ self.config = list(self.new_config)
--- End diff --
In the way you put it, accessing the indexes, it changes both probably due
to some reference. However, if one adds some other cases - mainly the uso of
append(), as we have - you will see that it works. Check below:
>>> a = 1
>>> b = [1,2,3]
>>> c = "some random string :)"
>>> z = [a,b,c]
>>> x = list(z)
>>> x[1][1] = 100
>>> print x
[1, [1, 100, 3], 'some random string :)']
>>> print z
[1, [1, 100, 3], 'some random string :)']
>>> z = []
>>> print z
[]
>>> print x
[1, [1, 100, 3], 'some random string :)']
>>> z.append(1)
>>> print x
[1, [1, 100, 3], 'some random string :)']
>>> print z
[1]
>>>
Now, to show our complete use-case here:
for l in file:
new_config.append(l)
config = list(new_config)
Laters, for every new config item, we do:
new_config.append(x)
or
new_config.insert(index, item)
By using those operations we won't change the "config" variable.
Another example:
>>> x = [1,2,3]
>>> z = list(x)
>>> z.insert(1,5)
>>> z
[1, 5, 2, 3]
>>> x
[1, 2, 3]
>>> z.append(10)
>>> z
[1, 5, 2, 3, 10]
>>> x
[1, 2, 3]
>>>
What do you think?
> Redundant VPC with both routers as Master
> -----------------------------------------
>
> Key: CLOUDSTACK-8616
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8616
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Virtual Router
> Affects Versions: 4.6.0
> Reporter: Wilder Rodrigues
> Assignee: Wilder Rodrigues
>
> There is an intermittent problem with the keepalived on the redundant VPC
> routers. Sometimes both routers stay on Master state for a while.
> We are able to reproduce it only when testing with Marvin, which executes the
> calls very quick. When using the UI and following the same steps, it doesn't
> happen.
> Setting up:
> 1. Create a VPC using redundant VPC offering
> 2. Add 2 Tiers
> 3. Create 2 VMs in each Tier
> 4. Create ACLs to allow traffic on port 22 coming from 0.0.0.0/0
> 5. Acquire 4 public IPs
> 6. Create Port Forwarding rules - per IP - for port 22
> 7. Assign each PF created to one of the VMs
> 8. SSH to the VMs
> Testing fail over:
> 1. Stop the Master Router
> 2. Check the the Backup Router became Master
> 3. SSH to the VMs
> Testing failure:
> 1. Delete all port forwarding rules
> 2. SSH to the VMs
> 3. Verify that it no longer works
> Test recovering
> 1. Restart the router
> 2. Once the router is running, check that it's on Backup state
> 3. Add the port forwarding rules back
> 4. Verify that the routers are still on the same state: 1 Master and 1 Backup
> - That's the part when it fails during the Marvin tests
> - When 2 routers are on Master, by restarting 1 router will bring
> everything to a normal state: 1 master and 1 backup
> 5. SSH to the VMs
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)