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.
+ There is additional restrictions which prevent backend removal. First, a
+ backend cannot be removed if it is explicitely referenced by config elements,
+ for example via a use_backend rule or in sample expressions. Some proxies
+ options are also incompatible with runtime deletion. 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
#define PR_FL_CHECKED 0x00000040 /* The proxy configuration was fully checked (including postparsing checks) */
#define PR_FL_BE_UNPUBLISHED 0x00000080 /* The proxy cannot be targetted by content switching rules */
#define PR_FL_DELETED 0x00000100 /* Proxy has been deleted and must be manipulated with care */
+#define PR_FL_NON_PURGEABLE 0x00000200 /* Proxy referenced by config elements which prevent its runtime removal. */
struct stream;
*/
px->options |= PR_O_HTTP_UPG;
}
+
+ target->flags |= PR_FL_NON_PURGEABLE;
}
}
*/
px->options |= PR_O_HTTP_UPG;
}
+
+ target->flags |= PR_FL_NON_PURGEABLE;
}
*err_code |= warnif_tcp_http_cond(px, rule->cond);
}
goto out;
}
+ if (be->cap & PR_CAP_FE) {
+ msg = "Cannot delete a listen section.";
+ 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;
goto out;
}
- if (be->cap & PR_CAP_FE) {
- msg = "Cannot delete a listen section.";
+ if (be->flags & PR_FL_NON_PURGEABLE) {
+ msg = "This proxy cannot be removed at runtime due to other configuration elements pointing to it.";
goto out;
}
break;
}
+ /* TODO CLI set-var should not prevent server deletion as var value is instantly resolved. */
srv->flags |= SRV_F_NON_PURGEABLE;
chunk_destroy(&arg->data.str);
break;
}
+ /* TODO CLI set-var should not prevent proxy deletion as var value is instantly resolved. */
+ px->flags |= PR_FL_NON_PURGEABLE;
+
chunk_destroy(&arg->data.str);
arg->unresolved = 0;
arg->data.prx = px;
break;
}
+ /* TODO CLI set-var should not prevent proxy deletion as var value is instantly resolved. */
+ px->flags |= PR_FL_NON_PURGEABLE;
+
chunk_destroy(&arg->data.str);
arg->unresolved = 0;
arg->data.prx = px;