Skip to content

Commit 7bf3020

Browse files
committed
MINOR: proxy: prevent backend removal when unsupported
Prevent removal of a backend which relies on features not compatible with dynamic backends. This is the case if either dispatch or transparent option is used, or if a stick-table is declared. These limitations are similar to the "add backend" ones.
1 parent ad1e00b commit 7bf3020

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

doc/management.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,6 +2130,11 @@ del backend <name>
21302130
This operation is only possible for TCP or HTTP proxies. To succeed, the
21312131
backend instance must have been first unpublished.
21322132

2133+
There is also additional restrictions which prevent backend removal.
2134+
Currently, this is the case when deprecated dispatch or option transparent
2135+
are used. Also, a backend cannot be removed if there is a stick-table
2136+
declared in it.
2137+
21332138
This command is restricted and can only be issued on sockets configured for
21342139
level "admin". Moreover, this feature is still considered in development so it
21352140
also requires experimental mode (see "experimental-mode on").

src/proxy.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5014,6 +5014,16 @@ int be_check_for_deletion(const char *bename, struct proxy **pb, const char **pm
50145014
goto out;
50155015
}
50165016

5017+
if (be->options & (PR_O_DISPATCH|PR_O_TRANSP)) {
5018+
msg = "Deletion of backend with deprecated dispatch/transparent options is not supported.";
5019+
goto out;
5020+
}
5021+
5022+
if (be->table) {
5023+
msg = "Cannot remove a backend with stick-table.";
5024+
goto out;
5025+
}
5026+
50175027
if (be->cap & PR_CAP_FE) {
50185028
msg = "Cannot delete a listen section.";
50195029
goto out;

0 commit comments

Comments
 (0)