[master] 43af095e6 Extend debug.xid to also set/query the cache chunk size

Nils Goroll nils.goroll at uplex.de
Mon Feb 14 10:53:05 UTC 2022


commit 43af095e69726290da50d9fbcf5f5efb86d0be6c
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Feb 14 11:49:02 2022 +0100

    Extend debug.xid to also set/query the cache chunk size
    
    The fixed chunk size of one prevents testing the vxid cache behaviour.

diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index 2a102940e..ddcc8d8cd 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -222,9 +222,13 @@ cli_debug_xid(struct cli *cli, const char * const *av, void *priv)
 	(void)priv;
 	if (av[2] != NULL) {
 		vxid_base = strtoul(av[2], NULL, 0);
-		vxid_chunk = 1;
+		vxid_chunk = 0;
+		if (av[3] != NULL)
+			vxid_chunk = strtoul(av[3], NULL, 0);
+		if (vxid_chunk == 0)
+			vxid_chunk = 1;
 	}
-	VCLI_Out(cli, "XID is %u", vxid_base);
+	VCLI_Out(cli, "XID is %u chunk %u", vxid_base, vxid_chunk);
 }
 
 /*
diff --git a/include/tbl/cli_cmds.h b/include/tbl/cli_cmds.h
index 27443bc70..7ca9f0802 100644
--- a/include/tbl/cli_cmds.h
+++ b/include/tbl/cli_cmds.h
@@ -375,10 +375,10 @@ CLI_CMD(DEBUG_SHUTDOWN_DELAY,
 
 CLI_CMD(DEBUG_XID,
 	"debug.xid",
-	"debug.xid",
-	"Examine or set XID.",
+	"debug.xid [<xid> [<cachesize>]}",
+	"Examine or set XID. <cachesize> defaults to 1.",
 	"",
-	0, 1
+	0, 2
 )
 
 CLI_CMD(DEBUG_SRANDOM,


More information about the varnish-commit mailing list