Odd buried queue behavior

Author: georaldcCreated Feb 19, 2026Updated Mar 9, 2026

Using the latest 1.13 version available, I just noticed something strange with how buried jobs under a tube are recreated after beanstalkd starts up with binlogs enabled. If say I do the following:

insert new job id 1 reserve job id 1 bury job id 1 insert new job id 2 reserve job id 2 bury job id 2

The buried queue will contain job id 1, followed by job id 2 which makes sense. Both jobs will also produce stats showing the following:

reserves: 1 buries: 1

If I stop and restart the beanstalkd process though, it uses the binlog as expected to recreate its last state, and I see the jobs still buried but they now produce the following stats:

reserves: 1 buries: 2

Why did the buries stat increase again and could this potentially lead to an issue later? Another thing is if I insert more jobs, reserve and bury them:

insert new job id 3 reserve job id 3 bury job id 3 insert new job id 4 reserve job id 4 bury job id 4

and I restart beanstalkd, the buries stat will again increase on all jobs (so job 1 and 2 will now show "buries: 3" and job 3 and 4 will now show "buries: 2"). What's more, there's a chance that the order of buried jobs under this tube suddenly changes into the following:

job id 3 -> job id 4 -> job id 1 -> job id 2

Just wondering if this behavior is expected when binlogs are enabled.