Revision 64836e81
ID | 64836e812b9204958334e57a40d3b8012f79bda9 |
Fix a bug concerning TCP port release
Commit f396ad8 returns the TCP port used by DRBD disk back to the
TCP/UDP port pool using AddTcpUdpPort().
However, AddTcpUdpPort() writes the config on every invocation,
using _WriteConfig(). This causes two problems:
- it causes critical errors logged by VerifyConfig(), after the DRBD
disk removal, and until the actual instance removal. - if the code following AddTcpUdpPort() fails, the port is already
returned back the pool, which causes the port to have duplicates
(inconsistent config).
AddTcpUdpPort() is invoked in three cases:
- during InstanceRemove() through _RemoveDisks().
- during InstanceSetParams() in case of disk removal.
- during InstanceSetParams() through _ConvertDrbdToPlain().
This commit fixes the problem by removing the _WriteConfig() call from
AddTcpUdpPort(), delegate it to Update() via the
TemporaryReservationManager and ensure AddTcpUdpPort() precedes
Update().
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Files
- added
- modified
- copied
- renamed
- deleted