[PATCH 2/5] Add assert on overhead size on size of overhead with regard to the size of the persisted ban lists, so that we don't try to continously reexport the list for very little gain when space is tight.

Martin Blix Grydeland martin at varnish-software.com
Fri Dec 14 18:41:00 CET 2012


---
 bin/varnishd/cache/cache_ban.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index a96bc9c..64474a7 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -611,10 +611,13 @@ ban_info(enum baninfo event, const uint8_t *ban, unsigned len)
 		/* One or more stevedores reported failure. Export the
 		 * list instead. The exported list should take up less
 		 * space due to drops being purged and gones being
-		 * truncated. */
-		/* XXX: Keep some measure of how much space can be
-		 * saved, and only export if it's worth it. Assert if
-		 * not */
+		 * truncated. We assert that the overhead constitues
+		 * at least 10% of the persisted size so that we don't
+		 * try to continously reexport on tight space. If the
+		 * assertion fails, the persistent stevedores have too
+		 * little space for their ban lists */
+		assert(VSC_C_main->bans_bytes_overhead >
+		       VSC_C_main->bans_bytes_persisted / 10);
 		ban_export();
 	}
 }
-- 
1.7.10.4




More information about the varnish-dev mailing list