]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: prevent backend removal when unsupported
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 6 Jan 2026 15:38:05 +0000 (16:38 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 2 Mar 2026 13:08:30 +0000 (14:08 +0100)
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.

doc/management.txt
src/proxy.c

index 57179611e3f1ce089858fdb13ad2eb1aa38ed7e2..ec9e1164d6614b1279832a40f283e8e0a7f8ad67 100644 (file)
@@ -2130,6 +2130,11 @@ del backend <name>
   This operation is only possible for TCP or HTTP proxies. To succeed, the
   backend instance must have been first unpublished.
 
+  There is also additional restrictions which prevent backend removal.
+  Currently, this is the case when deprecated dispatch or option transparent
+  are used. Also, a backend cannot be removed if there is a stick-table
+  declared in it.
+
   This command is restricted and can only be issued on sockets configured for
   level "admin". Moreover, this feature is still considered in development so it
   also requires experimental mode (see "experimental-mode on").
index adbbd63f1076f33531e836ba92d63c50ee4bf01a..7dde6288787637f9b1e26919cdaf632d78f2c9cc 100644 (file)
@@ -5014,6 +5014,16 @@ int be_check_for_deletion(const char *bename, struct proxy **pb, const char **pm
                goto out;
        }
 
+       if (be->options & (PR_O_DISPATCH|PR_O_TRANSP)) {
+               msg = "Deletion of backend with deprecated dispatch/transparent options is not supported.";
+               goto out;
+       }
+
+       if (be->table) {
+               msg = "Cannot remove a backend with stick-table.";
+               goto out;
+       }
+
        if (be->cap & PR_CAP_FE) {
                msg = "Cannot delete a listen section.";
                goto out;