varnish-cache icon indicating copy to clipboard operation
varnish-cache copied to clipboard

bans are not forward compatible

Open nigoroll opened this issue 1 year ago • 0 comments

https://github.com/varnishcache/varnish-cache/blob/a62cb553d3a535c9d13a423c8f3d01366261ab1a/bin/varnishd/cache/cache_ban.c#L550

When loading a persistent storage from a later version which has a new ban format on an older version, a panic is triggered:

Wrong turn at cache/cache_ban.c:550:
Wrong BAN_ARG code
version = varnish-trunk revision 6d5aa36cc13f0d09211ffa74e68d7ca607d921d2, vrt api = 20.1
ident = Linux,6.1.0-29-amd64,x86_64,-jnone,-sfellow,-sdefault,-Elibvmod_slash.so,-hcritbit,epoll
now = 9508.824577 (mono), 1740567235.533489 (real)
Backtrace:
  ip=0x55e637bc3b05 sp=0x7f027ebfdd30 <VBT_format+0x35>
  ip=0x55e637afb063 sp=0x7f027ebfdd50 <pan_backtrace+0x33>
  ip=0x55e637afadaa sp=0x7f027ebfdd70 <pan_ic+0x37a>
  ip=0x55e637bc2d35 sp=0x7f027ebfdef0 <VAS_Fail+0x55>
  ip=0x55e637ac2ea4 sp=0x7f027ebfdf40 <ban_evaluate+0x2b4>
  ip=0x55e637ac7c90 sp=0x7f027ebfe000 <ban_lurker_test_ban+0x4b0>
  ip=0x55e637ac71be sp=0x7f027ebfe0a0 <ban_lurker_work+0x1be>
  ip=0x55e637ac6f22 sp=0x7f027ebfe100 <ban_lurker+0x162>
  ip=0x55e637b3783d sp=0x7f027ebfe160 <wrk_bgthread+0x13d>
  ip=0x7f02d648c1c4 sp=0x7f027ebfe460 <pthread_condattr_setpshared+0x4e4>
  ip=0x7f02d650c85c sp=0x7f027ebfe500 <__xmknodat+0x23c>

For this example, an obj.lru ban has been created with #4287 and then the storage loaded with 6d5aa36cc13f0d09211ffa74e68d7ca607d921d2, which does not have obj.lru.

nigoroll avatar Feb 26 '25 11:02 nigoroll