WAL not persist released job with new priority if new delay is 0
Issue
For release command, WAL doesn't persist job's new priority if delay is 0
Reproducation
start a beanstalkd with binlog
./beantalkd -b /tmp/xclient put 2 jobs with different priority
put [0 0 0 6] job_01 put [10 0 0 6] job_02client reserved job_1 which has highest priority, and release it with lower priority
20and no delayreserve-with-timeout [10] release [1 20 0]terminate and restart beantalkd with binlog manually
new client reserve job, want higher priority
job_02, but gotjob_01reserve-with-timeout [10] 1 job_01
Cause
Release command handler which in prot.c#L1575, write the released job into WAL only if delay > 0, means update_store is true, see enqueue_job() in prot.c#L530
Other
Maybe this is intentional, after enqueue_job, immediately process_queue to find a waiting connection and deliver the released ready job.
But if there is no waiting connections, the released ready job with new priority will be lost if beanstalkd suddenly terminated.
Source: beanstalkd/beanstalkd