v0.3.24
Seven pull requests and no milestone has closed, so this is a patch.
All of it is M8 compatibility work, and almost all of that is keyspace notifications: the six collection classes, the four subkey channels Redis 8 added, and the three events a client hears about that no command's reply covers. A file written by 0.3.23 opens unchanged under this version and a file written by this version opens under 0.3.23. No record kind was added.
Added
- The list, set, sorted set, stream and hash notification classes. A client subscribed to
__keyspace@0__:mykeyor__keyevent@0__:rpushnow hears about every write those five groups make, which takes the setting from the three classes 0.3.23 shipped to all of them. Four hundred and eleven cases were run against Redis 8.10.1 over a raw socket under twenty settings of the flag, comparing every channel and payload in the order they arrived and the replies alongside them, and they agree on all of them. Most of the work in a class is deciding when to stay quiet, because the reply and the notification answer different questions:LTRIMsays so even when nothing moved,SMOVEonto the set the member came from says nothing,ZADDon a member already at that score is not a write, andHGETEX ... PERSISTreplies the value whether or not there was a deadline to take off. - The four subkey channels Redis 8 added, which is
__subkeyspace@0__,__subkeyevent@0__,__subkeyspaceitem@0__and__subkeyspaceevent@0__. They carry the hash fields a command touched, with the length prefixed comma joined field list a real server sends and the same two rules about a key or an event name that would not read back apart, so a client that cares about one field of a large hash can subscribe to that field rather than to the key. - Keys that reached their deadline and keys an eviction took now say so. These are the first events here that no command asked for, so they leave
yo-kvon a hook rather than from a call site, and neither of them drags adelalong behind it, which is what a real server does and is easy to get wrong. The sweep reports the same way the lazy path does, so a key nobody read back still says it went. - A key coming into being now says so too, on the
newclass that Redis keeps out ofAon purpose. It goes out on the same hook and from the one function underneath every group that puts a record in the map, which is what puts it in front of the write that caused it without anything having to be told what that order is. Eighty two cases covering every way a key can be created were run against 8.10.1, includingRENAME,COPY,MOVE,RESTORE,SORT ... STORE,MSETand the store forms.
Changed
EXECkeeps its decode buffer on the session rather than building one per queued command, so a transaction of a hundred commands allocates once instead of a hundred times.- The allocation gate prints the frames when the site is not in this repository, which turns a failure that named a file nobody here wrote into one that shows the path from our code into it.
Fixed
- The active expire cycle had never run in the deployed server. The sweep hung off a maintenance slice that the serve loop does not use, so a server that wrote under a deadline and never read the keys back held every one of them until somebody looked. It now runs from the housekeeping call the loop does make, gated to once a millisecond and to a slice of keys, and two hundred keys written with
PX 60go fromDBSIZE 200to0inside two seconds on an idle server. Anybody who set a deadline and watched memory not come back was hitting this.