mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-15 20:12:08 +01:00
MINOR: proxy: prevent backend deletion if server still exists in it
Ensure a backend instance cannot be removed if there is still server in it. This is checked via be_check_for_deletion() to ensure "del backend" cannot be executed. The only solution is to use "del server" to remove on the servers instances. This check only covers servers not yet targetted via "del server". For deleted servers not yet purged (due to their refcount), the proxy refcount is incremented but this does not block "del backend" invokation.
This commit is contained in:
parent
7f725f0754
commit
053887cc98
@ -2128,7 +2128,8 @@ del backend <name>
|
||||
Removes the backend proxy with the name <name>.
|
||||
|
||||
This operation is only possible for TCP or HTTP proxies. To succeed, the
|
||||
backend instance must have been first unpublished.
|
||||
backend instance must have been first unpublished. Also, all of its servers
|
||||
must first be removed (via "del server" CLI).
|
||||
|
||||
There is additional restrictions which prevent backend removal. First, a
|
||||
backend cannot be removed if it is explicitely referenced by config elements,
|
||||
|
||||
@ -5048,6 +5048,11 @@ int be_check_for_deletion(const char *bename, struct proxy **pb, const char **pm
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (be->srv) {
|
||||
msg = "Only a backend without server can be deleted.";
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Second, conditions that may change over time */
|
||||
ret = 0;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user