Skip to content

v2.9.0

Choose a tag to compare

@alice-viola alice-viola released this 17 Nov 10:44
· 130 commits to master since this release

Queen MQ 2.9.0: the image is ghcr.io/queen-mq/queen:2.9.0 (linux/amd64 and linux/arm64), and :latest points at it. The JavaScript, Python, Go, Rust, PHP and C++ clients are 2.9.0: npm install queen-mq@2.9.0, pip install queen-mq==2.9.0, cargo add queen-mq@2.9.0, go get github.com/smartpricing/queen/clients/client-go/v2@v2.9.0, composer require queen-mq/php-client:^2.9.0, and for C++ the tag clients/client-cpp/v2.9.0. queen-protocol is 1.7.0. queenctl stays at 2.7.1 and the supervisor at 0.9.0: neither changed. The Jepsen campaign on the code of 2.9.0 ran 568 tests, all valid (benchmark-queen/2026-11-16-jepsen-29).

Upgrading from 2.8.1: a rolling restart; the new features turn on by themselves once every node
runs 2.9.0 (cluster version 8).
Until then a where, a reading queue, headers and link are
refused with cluster_version, and nothing a node writes changes form. Once the version moves, a
2.8.1 node no longer starts on the data: to keep the way back open while 2.9.0 proves itself, set
QUEEN_RAFT_CLUSTER_VERSION_MS=0 on every node, and remove it when you stay. The JavaScript,
Python, Go, Rust, PHP and C++ clients move to 2.9.0 and queen-protocol to 1.7.0; queenctl stays
at 2.7.1 and the supervisor at 0.9.0, unchanged. The Jepsen campaign ran on the code of 2.9.0: 568
tests, every one the harness has, the standby failovers among them, all valid: 561 at their first
run, 5 after the fixes below, and 2 with wrong answers under clock jumps of minutes counted, not
judged (benchmark-queen/2026-11-16-jepsen-29).

Rust: request types gained fields (breaking for struct literals). queen-protocol 1.7.0, which
the Rust client takes and re-exports, adds headers to PushItem, TxnPushItem, TimerOperation
and SinkPushItem, and the variant KvReason::Expired. Code that writes one of those types as a
struct literal no longer compiles: build it with new(...) and its setters (.partition(),
.transaction_id(), .headers()), which work on 2.8.1 too, or add headers: None; a match on
KvReason needs an arm for Expired. The Rust tutorials now build them that way.

Routing without copies: filtered groups, reading queues and link. A consumer group can take
only the messages a where takes (.group('billing').where('data.kind', '=', 'order.paid')),
fixed at its first pop. A queue can read other queues (config({ from: 'orders', where: "data.country = 'IT'", partitionBy: 'same' })): it gets a link to every message its where
takes, in the same commit as the push, with its own leases, retries, dead-letter queue, groups and
token; partitionBy: 'data.customerId' gives the same messages another order, from: [...]
merges queues in commit order, start: 'all' starts with history. A transaction can forward the
message it holds into another queue with link, without sending its payload again. A link is
written once at the source and costs about 20 to 80 bytes, whatever the payload weighs; the
source keeps the message, and its completed retention waits for its readers. Why: a reader that
wanted some of a queue read and acked all of it, and routing meant a router process that copied
every message and added a commit per batch.

A stream's .to() writes a link when its result is its input message unchanged ({ link: false }
writes copies), and the feed shows a reading queue's and a link target's messages read through
their links. A link a partition already holds is a no-op, not a duplicate rollback. Every pop
of a filtered group says "filtered": true, an empty one too, so a client stops on a broker that
would ignore its where; group listings show a filtered group under its queue with its where,
and a queue's page shows its readers' ages, its holders and a catch-up's progress.

A queue its consumers popped first can become a reading queue. from on an ordinary queue is
accepted while no message was ever pushed to it, and refused once it holds messages. Why: a pop
of a queue that does not exist creates it, so a consumer that started before the configure call
made the name an ordinary queue, which could never become the reading queue it was waiting for
(found by the Jepsen tests).

Lag and backlog with filtered groups, and unread. A filtered group's lag and depth count only
the messages its where took, on the partitions it took them from, under its queue's name
(the group listings, /depth?group=, queen_consumer_group_lag_*). A queue's pending is,
partition by partition, the most that one of its groups, its own or filtered, has not consumed,
plus every unread message. unread is new: the messages on partitions that no group of the queue
reads and no reader's where can take (messages.unread on the queue list and the overview,
totals.unread and each partition's unread on a queue's page, unread on /depth); the
console marks such a queue "No reader". A filtered group's own storage shows in no listing, chart
or metric, and a pop by namespace or task hands a filtered group's messages out once. Why: a
filtered group that counted the whole queue as its lag would look behind for ever, and the
partitions nothing reads are the gap worth seeing.

Headers. A message can carry headers, a map of strings stored in clear beside its payload
(headers: { type: 'order.paid', traceparent: '...' }), returned by pop, fetch, the feed and the
message browser, readable by a where without the payload (so on an encrypted queue too). A timer
takes them and its message fires with them; a dead letter keeps them and its replay sends them
again. Kafka records keep their headers as before, and their UTF-8 ones are also stored as Queen
headers. A refused push item now says why, as error. Why: without headers, trace context and
routing facts lived inside payloads.

A MySQL source, in the broker. The broker streams MySQL tables into queues by reading the binlog
the way a replica does, with no other process: PUT /api/v1/connectors/:name with "engine": "mysql". Each committed row change is a message in the partition named after the row's key, in
commit order, shaped like the PostgreSQL source's with gtid in place of lsn and xid; the rows
already there are copied first (snapshot: "initial") while the binlog streams, with no lock. A
MySQL transaction's changes and the GTID set the source reached commit as one QueenMQ transaction,
so after a crash nothing is lost and nothing is sent twice. A rename stops the source, an ALTER is
followed, and text is read in its column's charset. It needs MySQL 8.0 or later (8.0, 8.4 and 9.7
tested; not MariaDB) with GTIDs on and binlog_row_metadata=FULL, and QUEEN_ENCRYPTION_KEY, which
seals the stored password. Why: getting changes out of MySQL usually means Debezium, a Kafka
Connect cluster and Kafka.

One planner on every thread: the footprint scheduler. The leader's lanes (pid % 8) and its
one control step are gone. Before a cycle is planned, every command names what it reads and
writes (a partition, a queue's settings, a KV key, a timer, a cursor); commands that share none of
these plan at the same time on QUEEN_PLANNER_THREADS threads (8 by default, QUEEN_LANES is
still read), and the entry holds every command in batch order, as one thread would have planned
it. A check after planning compares what each group touched with what the others wrote, and plans
that part of the batch again on one thread when they met. Transactions that ack, push and write
KV or timers, KV calls, timers, pushes to queues that others read and first pushes to new
partitions no longer wait for one thread. Followers apply the entries as before: no cluster
version, a rolling restart. Why: the control step was the transaction ceiling, about 70 µs a
transaction on one thread whatever the machine's size.

Connections, commits and transactions a second. Prometheus gets queen_connections,
queen_connections_max, queen_connections_accepted_total and queen_connections_refused_total
by listener (broker is PORT, proxy is the embedded proxy's own port),
queen_raft_committed_entries_total (one log entry is one commit; take the max over the nodes,
never the sum) and queen_process_transactions_total by outcome (committed, rolled_back,
refused, error). The console's Cluster page charts the three for each node, the cluster chip in
the band shows the commits a second, and the Overview lists commits and connections. Each node's
entry in GET /api/v1/raft/members carries the same figures as work. Why: how many clients a
node holds, and how many commits and transactions it does in a second, showed nowhere.

The sign-in page has the console's look. It opens in the theme and the areas the console's
theme chip saved in this browser; with nothing saved, in the console's first look, Soft with Tone
areas. Its colours are the console's, and its sign-in button is white, as the console's main
buttons are. Why: the page still wore the old dashboard's colours and yellow button after the
console replaced that design, so signing in and out jumped between two designs.

Fixed: maxWaitTimeSeconds and a short retention on a busy partition. A partition that took
more than 1,000 pushes inside its dedup window stopped removing messages when the queue said:
maxWaitTimeSeconds, retentionSeconds and completedRetentionSeconds then removed a message
only about when its dedup row left, an hour later by default. Retention now starts at the oldest
message the partition still keeps. Why: a step read its 1,000 rows from the oldest dedup row, and
on a busy partition those were all rows of messages already removed (found by the Jepsen tests,
in 2.8.1 too).

Fixed: a KV write with a TTL that is committed late. A put or putIfAbsent with
ttlSeconds now answers expiresAt, and one the cluster committed after its lifetime was over
answers applied: false with reason: "expired". A lock acquire in that state is made again
inside the call; a renew answers lost. Why: a TTL is counted from when the leader plans the
write. A write committed seconds later, across a leader change, was answered applied: true
although it had already expired, and the next putIfAbsent or lock acquire won at once: two
holders (found by the Jepsen tests, in 2.8.1 too). A transaction's KV operations are answered as
before: the transaction committed. The Rust SDK's KvReason gets Expired (a Rust client older
than this release cannot parse that answer and returns an error for it) and the Go SDK
KVReasonExpired.

Fixed: a transaction's KV reads answer what was there at its place in the log. A get or
getMany in a transaction's kv now sees every write committed before the transaction and the
transaction's own writes, and nothing written after it, as a POST /api/v1/kv call's reads
already did. A transaction that only reads now takes a place in the log too. Why: the reads were
answered once the transaction's log entry had applied on the node, and by then the commands
planned after it could have applied as well. Two transactions sent together, each reading the key
the other writes, each saw the other's write, which no order of the two explains (found by the new
Jepsen test W32, Elle on /api/v1/transaction, in 2.8.1 too). What a transaction writes and the
conditions on its writes were never affected: those are decided in the log's order.

Fixed: a pop nobody waits for takes no lease. When a node stops or dies, the leader drops the
long-poll pops that node had forwarded to it, and a PostgreSQL sink's worker that stops no longer
leaves its pop running. Why: such a pop went on waiting, took the next messages and answered
nobody, and their partitions stayed leased until the lease ran out: 60 seconds of nothing written
for a sink after a restart (found by the Jepsen tests, in 2.8.1 too).

Fixed: a log line that cannot be written no longer kills the broker. When the broker's output
could not be written (its log file on a disk that filled up, a pipe whose reader was gone), the
process aborted at its next log line and left no message. Such a line is now dropped and the broker
goes on; a node whose disk is full stops the way the recovery page says. Why: the logging library
reported the failed write on stderr, that write failed too, and the failure counted as a crash. In
the Jepsen disk-full tests 13 of the 21 nodes a full disk took out had died this way, with no
acknowledged write lost (in 2.8.1 too).

Fixed: a node a full disk stopped starts again. Restarted after its disk was freed, such a node
could refuse to start for good (raft storage failed to open: ... Failed to get log entries), so
the recovery page's "grow the volume and restart it" did not work. Why: the raft log writer saved
the commit point that came after a group of entries even when that group had failed to reach the
disk, so the point said more than the disk held, and at start the node looked for entries it never
wrote. The writer now saves no commit point once a write has failed, and at start a commit point
past the last entry on disk counts as unknown: the leader sends it again. Nodes already left in
that state start again with this release. No acknowledged write was lost: the other nodes held the
entries. Found by the Jepsen disk-full tests on 2.9.0-beta.1.

Fixed: deleting a queue with filtered groups deletes it. The delete answered deleted: true,
but only the first of its filtered groups' hidden queues went: the queue itself stayed, with its id
and its messages, and a push of a transactionId it held came back duplicate. Deleting a filtered
group could leave its hidden queue the same way. Why: the delete sent each hidden queue's delete
and then the queue's own under the request's one id, and the broker answers a request id it has
seen as the replay of that command, without running it. Each one now goes as a command of its own.
Plain, encrypted and normal-group queues were not affected.

Fixed: a dead letter always carries its message. A message dead-lettered by a failed ack
that spent its last retry, or by a dlq ack, could be filed without its payload: the DLQ listed it
with its transaction id and data: null, on every node. Such an ack is now refused with a 503 (the
SDKs send it again) and nothing moves, and the retry files the message whole. Why: the node that
takes an ack copies the message from its own log into the dead letter, and a node that had not
applied that message yet (a follower serving its own clients, or a leader just elected, while its
read barrier failed) sent the copy empty, and the leader filed it. Found by the Jepsen DLQ tests
during a graceful restart of the leader (2 of 10,418 dead letters; in 2.8.1 too).

Fixed: a node that receives a snapshot while it starts restarts to load it. A node that came
back after a long absence and was sent a snapshot before it had finished starting logged
FATAL: raft storage failed to open: ... installing the snapshot at ... and exited with code 1. It
now exits with code 75, like a running node that receives a snapshot, and its next start loads the
snapshot. Why: the start treated the restart the snapshot asks for as a failure to open. No data
was involved, but a FATAL that reads like a broken disk could send an operator to the recovery
page, and a supervisor that restarts on 75 only left the node down. Found by the Jepsen membership
tests (in 2.8.1 too).

Fixed: a change of voters finishes even when its request goes away. A membership change, such as
promoting a standby, is made in two steps, and the second ran inside the request: a change whose
request ended first (its timeoutMs, the operator's connection closing, or the follower that
forwarded it restarting to load a snapshot) stopped between the two. The group stayed joint and
refused every later change with 409 in_flight until an operator finished it, and after a deadline
the leader paused its writes for up to two minutes. The change now runs on its own until both steps
are taken; a request that ends first answers 504, and the leader goes on. Found by the Jepsen
standby test (in 2.8.1 too).

Fixed: an ephemeral partition that moves loses no message and hands none out twice. While a
partition moved to another node (a restart, a rolling restart, a node joining or leaving), the new
owner could take a push before the old owner's ring arrived. Its new ring knew only the consumer
groups that had popped there, and freed a message as soon as they had taken it, so a group whose
cursor was on its way in the old ring never got it. And when the old ring landed in one that
already held messages, every group was handed again what it had already taken on the old owner: a
commitOnDelivery group got messages twice. A ring created while partitions may still be moving now
keeps what its groups take until the old ring lands, or for 10 seconds, and each group's place, with
what it already took, travels with the ring, also when it moves twice. Found by the Jepsen
ephemeral tests (restart, kill, partition and pause), in every campaign since 2026-11-14; in 2.8.1
too.

Fixed: an acquire takes one permit and answers it as new, even when a node's clock runs ahead.
When the clock of the node that took an acquire ran ahead of the leader's by more than the lock's
lifetime, a lock could be answered already: true for a permit the call had just taken, and a
semaphore could give the same owner a second slot, whose next acquire was then answered already
with the first. Why: that node judged the acquire's own write expired, read the slots again, judged
its own row expired too, and went on to another slot. The acquire now writes the slot it landed in
again first, and the leader judges that write on the clock that stamped its lifetime. Found by the
Jepsen lock and semaphore tests under clock faults far past the 500 ms the cluster allows; 2.8.1
does not have it (it came with the fix above that answers a late write as expired).

Fixed: a busy broker with a long dedup window no longer stops after a few minutes. The memory
the leader gives to finding duplicates fast (QUEEN_RAFT_DEDUP_FRONT_MB) now defaults to a quarter
of the broker's memory (its cgroup limit, else the machine's RAM), never under the 4 GiB it was
before, and the broker logs a warning, at most once a minute, when that memory runs out. Why: past
4 GiB a busy partition checked every message it was pushed against its whole dedup window, about
half a second a push, and stayed that way while it was written to. Three raft groups at 4 million
messages a second with a 15-minute window, on 90 GB nodes, went from 4 million messages a second to
none after 8.5 minutes, with 45 GB in use and nothing in the log (in 2.8.1 too).