Repository navigation
Releases
Releases · MegacoderKim/pg2redis
pg_redis_core v0.6.0
Added
- Multiple Logical Redis Databases (
SELECT 0..N-1,pg_redis.databases):- Added
pg_redis.databasesGUC (default16, range1–1024,SIGHUP) matching standard Redis behavior so clients likeioredis,BullMQ,redis-py,go-redis/v9, andJediscan connect to numbered databases (redis://host:6379/1,SELECT 2, etc.). - Added
db SMALLINT NOT NULL DEFAULT 0column and composite(db, ...)primary keys/indexes across all 7 catalog tables (pg_redis_strings,pg_redis_key_expiry,pg_redis_hashes,pg_redis_lists,pg_redis_zsets,pg_redis_sets,pg_redis_streams) while keeping SQL inspection clean (WHERE db = 0) and preserving all existing DB0rows. - Scoped L1 hot-key cache (
L1Cache), blockingKeyNotifierwakeups (BZPOPMIN,BLPOP,XREAD BLOCK), Lua 5.1EVAL/EVALSHA, universal TTL eviction,DBSIZE,KEYS,SCAN, and all 6 data types per(db, key). Pub/Sub remains global across databases (matching real Redis). - Updated
FLUSHDB [ASYNC|SYNC]to clear only the currently selected database whileFLUSHALL [ASYNC|SYNC]clears all databases. - Added
MOVE key db(atomically moving keys + TTL without overwriting destination keys) andSWAPDB index1 index2(atomically swapping two databases). - Exposed
databasesinINFO # Serverand dynamicCONFIG GET databases.
- Added
- Upgrade Script & Tests:
- Added
sql/pg_redis_core--0.5.0--0.6.0.sql(plus startupensure_schema()safety-net migration) to cleanly migrate pre-0.6.0 tables with zero data loss. - Added
tests/clients/pubsub/test_multidb.mjs(wired intotests/run_all_tests.sh) andpg_test_multi_database_isolation_and_opsinsrc/lib.rs.
- Added
Prebuilt Extension Binaries (SHA-256)
135ca44bd1b35bc1af9a050cc0c0524dc9e1ffe88bba5e421f215295f2def3b3 pg_redis_core-0.6.0-pg16-linux-arm64.tar.gz
7841f877333534a3755afc42307d87d74c5ca485a01fff44d5fb6a5f6bfe2fc1 pg_redis_core-0.6.0-pg15-linux-arm64.tar.gz
92ae08f9f3abb63cf1994520f6a12f2b83baadd6fe8ba7d17c05d76eed91b94d pg_redis_core-0.6.0-pg15-linux-amd64.tar.gz
cdbf11b154a7fe16b206c84ce61046b2ec00fb1b562ab71648eb3bc989df53d1 pg_redis_core-0.6.0-pg16-linux-amd64.tar.gz
Docker Images (Multi-Arch: linux/amd64, linux/arm64)
# PostgreSQL 15
docker pull ghcr.io/megacoderkim/pg2redis:v0.6.0-pg15
# PostgreSQL 16
docker pull ghcr.io/megacoderkim/pg2redis:v0.6.0-pg16Documentation
pg_redis_core v0.5.0
Added
- Optional Native TLS (
rediss://) & mTLS (src/tls.rs,src/worker.rs,src/config.rs):- Strictly opt-in via
pg_redis.tls_port(default0, disabled) so plain non-TLS TCP on port6379continues working unchanged by default. - Supports all three deployment modes:
- Plain TCP only (default):
pg_redis.port = 6379,pg_redis.tls_port = 0. - Dual-port (Plain TCP + TLS simultaneously):
pg_redis.port = 6379,pg_redis.tls_port = 6380withpg_redis.tls_cert_fileandpg_redis.tls_key_file. - TLS-only (Encrypted only):
pg_redis.port = 0,pg_redis.tls_port = 6380(mirrors Redisport 0+tls-port).
- Plain TCP only (default):
- Optional mutual TLS (mTLS) client certificate authentication via
pg_redis.tls_ca_cert_fileandpg_redis.tls_auth_clients(no|optional|yes). - Built on pure-Rust
tokio-rustls+ring(TLS 1.2 & TLS 1.3) to avoid OpenSSL/libsslsymbol conflicts with PostgreSQL, with non-blocking 10-second handshake timeouts so stalled handshakes never affect other clients. - Live Certificate Hot-Reload on
SIGHUP:SELECT pg_reload_conf();reloadspg_redis.tls_cert_file,pg_redis.tls_key_file,pg_redis.tls_ca_cert_file, andpg_redis.tls_auth_clientswithout restarting PostgreSQL (keeping the previous working configuration on reload error). - Exposed
tls_portinINFO # Serverandtls-port/tls-auth-clientsinCONFIG GET.
- Strictly opt-in via
- Upgrade Script & E2E Tests:
- Added
sql/pg_redis_core--0.4.1--0.5.0.sql. - Added
tests/test_v050_tls.shandtests/clients/pubsub/test_tls.mjsverifying dual-port mode (ioredis+redis-cli --tls, cross-transport Pub/Sub,BZPOPMINover TLS, plaintext rejection on TLS port), TLS-only + mTLS enforcement, and liveSIGHUPcertificate hot-reload, plus#[pg_test]opt-in default checks.
- Added
Prebuilt Extension Binaries (SHA-256)
0bb7a8efb5ba9b70478d006d6146e911a4c02462e1231fe4483df177f3b6a1e9 pg_redis_core-0.5.0-pg15-linux-amd64.tar.gz
56dfef12fe80defccf7fb734db4a58926b191136d29c9a97cbc91d147892b0ed pg_redis_core-0.5.0-pg15-linux-arm64.tar.gz
7a22435c6ccc29ed58821a71e7607b94fb5e60d516b559d7feb2ad1eb2086fe5 pg_redis_core-0.5.0-pg16-linux-amd64.tar.gz
e40888930efa3f0514cab6e8b57cd49343ad433641e569cefa2c24fb54055d27 pg_redis_core-0.5.0-pg16-linux-arm64.tar.gz
Docker Images (Multi-Arch: linux/amd64, linux/arm64)
# PostgreSQL 15
docker pull ghcr.io/megacoderkim/pg2redis:v0.5.0-pg15
# PostgreSQL 16
docker pull ghcr.io/megacoderkim/pg2redis:v0.5.0-pg16Documentation
pg_redis_core v0.4.1
Fixed
- CI / Pub/Sub Test Reliability: Awaited
ioredisreadystate on all Pub/Sub subscriber clients intests/clients/pubsub/test_pubsub.mjsbefore callingsubscribe()/psubscribe(), eliminating an intermittentioredis@5.11.1readyCheck(INFO) vs. RESP2 subscribed-mode race. - Upgrade Script: Added
sql/pg_redis_core--0.4.0--0.4.1.sql.
Prebuilt Extension Binaries (SHA-256)
476c4376820ef100c61242b2c76c564f2c5f7c3997bd33672e79a9a507687169 pg_redis_core-0.4.1-pg15-linux-arm64.tar.gz
4f628cf1f7360fdb9e55ab88a7733b131a00f2fa3161eb41dd3fe4fab29c79b7 pg_redis_core-0.4.1-pg15-linux-amd64.tar.gz
c1bd68b3b67c456c0dacaeb5a0fc56d25274ca17512e7a5c8009a0b3fd56d068 pg_redis_core-0.4.1-pg16-linux-amd64.tar.gz
da52f6b3b03bb811a83fb5d801fa6869cddfd5068b0c6c2d7a7e3161d3c75561 pg_redis_core-0.4.1-pg16-linux-arm64.tar.gz
Docker Images (Multi-Arch: linux/amd64, linux/arm64)
# PostgreSQL 15
docker pull ghcr.io/megacoderkim/pg2redis:v0.4.1-pg15
# PostgreSQL 16
docker pull ghcr.io/megacoderkim/pg2redis:v0.4.1-pg16Documentation
pg_redis_core v0.4.0
Security & Stability
- Sandboxed Lua 5.1 VM (
src/lua.rs): Restrictedmluato safe standard libraries (table,string,math) and strippedos,io,package,debug,dofile,loadfile,collectgarbage,module, andrequire. Added configurable instruction-hook execution timeout (pg_redis.lua_time_limit_ms, default5000ms) to prevent runaway scripts from stalling the background worker. - Real
AUTH&HELLO ... AUTHEnforcement (pg_redis.requirepass): AddedSUPERUSER_ONLYGUCpg_redis.requirepasswith constant-time password verification supporting bothAUTH <pass>andAUTH default <pass>as well asHELLO <proto> AUTH default <pass>, returningNOAUTH/WRONGPASSwhen configured. - Connection & Memory Safeguards: Added
pg_redis.max_clients(default1000),pg_redis.max_frame_bytes(default64 MiB), and bounded per-subscriber Pub/Sub queues (pg_redis.pubsub_queue_size, default4096) with automatic slow-consumer eviction.
Added
- Universal Key Expiration (
pg_redis_key_expiry): ExtendedEXPIRE,PEXPIRE,EXPIREAT,PEXPIREAT,TTL,PTTL,PERSIST, and background TTL eviction to work across all 6 data types (Strings, Hashes, Lists, Sorted Sets, Sets, and Streams), added Redis 7NX/XX/GT/LTflags, and addedEXPIRETIME/PEXPIRETIME. - Collection Scans & Session Helpers: Added
HSCAN(includingMATCH,COUNT,NOVALUES),SSCAN,ZSCAN, fixedSCAN ... TYPE <type>filtering, and addedGETEX(EX,PX,EXAT,PXAT,PERSIST) for rolling session TTLs (connect-redis) and BullMQFlowProducer/ dependency pagination. - Multi-Client Registry (
src/clients.rs): UpgradedCLIENT LIST(withTYPE/IDfilters),CLIENT INFO,CLIENT KILL(ID/ADDR), andINFO# Clients(connected_clients,maxclients) across all active TCP connections so BullMQqueue.getWorkers()andqueue.getQueueEvents()report live workers. - Pattern Pub/Sub (
src/pubsub.rs): AddedPSUBSCRIBE,PUNSUBSCRIBE,pmessagepush delivery, and livePUBSUB NUMPATcounts over the in-processPubSubHub. - Upgrade Script: Added
sql/pg_redis_core--0.3.0--0.4.0.sqlcreatingpg_redis_key_expiry.
Prebuilt Extension Binaries (SHA-256)
14620397ced8b1a3e7a6dd3d4289378eb8ff1497bfcdcd2f30a2d09670b3d3fa pg_redis_core-0.4.0-pg15-linux-amd64.tar.gz
42d2dd039181be5a295f58e381bc1fab57a8fa02b4ab3e88596b80d423f8d270 pg_redis_core-0.4.0-pg16-linux-arm64.tar.gz
854cde95b2784abf9913119b9eed9338411c28eea96091adf72ac049575ca3da pg_redis_core-0.4.0-pg15-linux-arm64.tar.gz
abf3189cb2049aec38309c8016e7d4ce14a7244f8ab814fa0b030b57c08cb78e pg_redis_core-0.4.0-pg16-linux-amd64.tar.gz
Docker Images (Multi-Arch: linux/amd64, linux/arm64)
# PostgreSQL 15
docker pull ghcr.io/megacoderkim/pg2redis:v0.4.0-pg15
# PostgreSQL 16
docker pull ghcr.io/megacoderkim/pg2redis:v0.4.0-pg16Documentation
pg_redis_core v0.3.0
Added
- Redis Pub/Sub (
src/pubsub.rs) for Medusa 2.22.7 workflow notifications (ioredis 5.11.1):- Named-channel
PUBLISH,SUBSCRIBE,UNSUBSCRIBE,PUBSUB CHANNELS [pattern],PUBSUB NUMSUB [ch ...],PUBSUB NUMPAT, andRESET. - Exact Redis wire acknowledgements (
["subscribe", ch, count],["unsubscribe", ch, remaining],["unsubscribe", null, 0],["message", ch, payload]), RESP3 Push frames (>N), idempotent duplicate subscriptions, multi-channel subscriptions, single-channel and zero-arg unsubscribe-all, and exactPUBLISHlive recipient counts. - Strict RESP2 subscribed-mode enforcement (allowing
SUBSCRIBE,UNSUBSCRIBE,PINGreturning["pong", msg],QUIT, andRESET) while permitting concurrent commands in RESP3. - Zero-copy in-process
PubSubHubover per-connection Tokiompsc::unbounded_channelon the single-threaded background workerLocalSet: zero PostgreSQL SPI overhead, arbitrary binary-safe payloads exceeding PostgreSQL's 8 KBNOTIFYlimit (verified at 32 KB+), strict FIFO ordering, idle subscribers never block other clients or BullMQ workers, and RAIIPubSubClientGuardcleanup on disconnect. - Support for
redis.call('PUBLISH', ...)inside Lua 5.1 scripts andPUBLISHinsideMULTI/EXECtransactions.
- Named-channel
- PostgreSQL 16 Build & Release Matrix:
- Parameterized
docker/DockerfilewithARG PG_MAJOR=15supporting both PostgreSQL 15 and PostgreSQL 16 (cargo pgrx package --features pg15|pg16). - Expanded
.github/workflows/release.ymlto build, smoke-test, and publish prebuilt extension binaries and multi-arch GHCR images forpg15-linux-amd64,pg15-linux-arm64,pg16-linux-amd64, andpg16-linux-arm64. - Added PostgreSQL extension upgrade script
sql/pg_redis_core--0.2.0--0.3.0.sql.
- Parameterized
- End-to-End Test Suites:
- Added
tests/clients/pubsub/pinningioredis@5.11.1andbullmq@5.13.0covering all Pub/Sub edge cases, idle concurrency, disconnect/reconnect/resubscribe, 100-message FIFO ordering, binary safety, and 32 KB+ payloads. - Added
tests/test_solar_nest_isolation.shverifyingpg_redis.database=solar_nest_redisisolation from application databasesolar_nestalongside Pub/Sub + BullMQ 5.13.0 on both PostgreSQL 15 and PostgreSQL 16.
- Added
Prebuilt Extension Binaries (SHA-256)
170438ca82242e234bb4ca7d2cc0b5bb29abfa27950b434cf3979bfc89967b67 pg_redis_core-0.3.0-pg15-linux-amd64.tar.gz
593afc86983eb325d40dd7bd9893087a4de06e5811a7d914db52ec93a5c8d9d4 pg_redis_core-0.3.0-pg15-linux-arm64.tar.gz
6f851a75a7e5769fe75db1a441653be9ecd279bc3458cc233fb34c7b2a6290be pg_redis_core-0.3.0-pg16-linux-arm64.tar.gz
d1b54174fe359c726cbbae063a7db2fcf69cfe9b77068aaffde6e196071efa55 pg_redis_core-0.3.0-pg16-linux-amd64.tar.gz
Docker Images (Multi-Arch: linux/amd64, linux/arm64)
# PostgreSQL 15
docker pull ghcr.io/megacoderkim/pg2redis:v0.3.0-pg15
# PostgreSQL 16
docker pull ghcr.io/megacoderkim/pg2redis:v0.3.0-pg16Documentation
pg_redis_core v0.2.0
Added
- Embedded Lua 5.1 Scripting (
mluavendored Lua 5.1):EVAL,EVALSHA,EVAL_RO,EVALSHA_RO,SCRIPT LOAD,SCRIPT EXISTS,SCRIPT FLUSHwith SHA1-cached compiled Lua functions and exactNOSCRIPTerrors forioredis.- Full Redis Lua sandbox globals: binary-safe
KEYS/ARGV,redis.call,redis.pcall,redis.status_reply,redis.error_reply,redis.sha1hex,redis.log,cjson,cmsgpack(rmpv), andbit. - Exact Redis Lua ↔ RESP conversions executing atomically inside the active PostgreSQL SPI transaction.
- Redis Streams (
pg_redis_streams):XADD(monotonic*,<ms>-*,<ms>-<seq>,NOMKSTREAM,MAXLEN [~|=],MINID),XTRIM,XLEN,XRANGE,XREVRANGE,XDEL, andXREAD [COUNT] [BLOCK] STREAMS(including$cursors).
- Cooperative Blocking Operations (
KeyNotifier):- Async non-polling
BZPOPMIN,BZPOPMAX,BLPOP,BRPOP, andXREAD BLOCKwoken immediately after PostgreSQL transaction commits.
- Async non-polling
- Redis Sets (
pg_redis_sets):SADD,SREM,SMEMBERS,SISMEMBER,SCARD,SPOP.
- BullMQ 5.13.0 / Medusa Command Parity:
- Added
ZPOPMIN,ZPOPMAX,ZREMRANGEBYRANK,ZREMRANGEBYSCORE,LTRIM,LPOS,RPOPLPUSH,LMOVE,RENAME, andmaxmemory_policy:noevictioninINFOandCONFIG GET. - Added PostgreSQL extension upgrade script
sql/pg_redis_core--0.1.0--0.2.0.sql. - Added end-to-end Dockerized
bullmq@5.13.0integration suite (tests/clients/bullmq).
- Added
Docker Image (Multi-Arch: linux/amd64, linux/arm64)
docker pull ghcr.io/megacoderkim/pg2redis:v0.2.0