Releases: CleverCloud/magnetar
Releases · CleverCloud/magnetar
magnetar 1.1.1
[1.1.1] - 2026-06-17
Added
magnetar-admintopic stats — full rate/throughput/size surface:TopicStatsnow decodes the high-signalPersistentTopicStatsmetrics it previously dropped:msgRateIn,msgRateOut,msgThroughputIn,msgThroughputOut,averageMsgSize,storageSize, andbacklogSize(alongside the existingmsgInCounter/bytesInCounter).magnetarctl admin topics stats <topic>emits all of them in its JSON output, sojq '.msgRateIn'(and the out-rate, throughput, and storage/backlog sizes) now work for both non-partitioned and partitioned topics. Fields default to0when a broker release omits them. (#293)magnetarctlmessage-id output —segmentIdno longer dropped: under thescalable-topicsfeature,topics terminateandtopics get-message-id-by-indexnow surface the PIP-460segmentId(JSONnullwhen absent) instead of silently omitting it; both commands share onemessage_id_to_jsonrenderer so their shapes can't drift. (#293)
Changed
- CLI (
magnetarctl) default log level lowered towarn: the default floor dropped frommagnetar=infotomagnetar=warn, somagnetarctlis quiet by default and surfaces only degraded-state warnings and errors. The whole-vladder shifted down one rung — no capability is lost:-vnow maps toinfo(the old default),-vvtodebug,-vvvtotrace, and-vvvv+ widen into the transport stack (reqwest/hyper/rustls/h2). Scripts that relied on the priorinfo-level default output must now pass-v.docs/cli.mdanddocs/logging.mdupdated to match. (#292) - Dependencies: bumped
zeroize1.8.2→1.9.0. (#288)
magnetar 1.1.0
[1.1.0] - 2026-06-16
Added
- Admin client (
magnetar-admin) OAuth2 + TLS:AdminClientBuildergainsoauth2(...),tls_trust_cert_pem(...), andtls_allow_insecure(...); a newAdminAuth::OAuth2arm refreshes the cached token on demand and attaches it as a bearer credential (erroring clearly on an empty access token).magnetar-adminnow depends onmagnetar-auth-oauth2(acyclic) and forwards eachcrypto-*feature to it so the token-exchange client binds the same rustls provider. (#281) - CLI (
magnetarctl) pulsarctl config file + contexts:magnetarctlnow reads the standard pulsarctl config (--config>MAGNETAR_CONFIG>$XDG_CONFIG_HOME>$HOME/.config/pulsar/config) and ships acontextcommand group (use/set/delete/get/current/rename, withcreate/del/updatealiases) matching the pulsarctl output strings — a working pulsarctl setup now works with zero extra flags. Unknown keys and key casing round-trip untouched, so a magnetarctl-written file stays pulsarctl-readable. New global flags--config,--context,--token-file,--tls-trust-cert-path,--tls-allow-insecure,--tls-enable-hostname-verification,--tls-cert-file,--tls-key-file, and-s(short for--admin-url); the active context supplies the admin URL + auth + TLS, and the data-plane URL is derived from the admin-service-url (http→pulsar://…:6650,https→pulsar+ssl://…:6651) unless an explicit--service-urlis given. (#281, #284; ADR-0068) - CLI
context rename --force(-f): opt into overwriting an existing destination context; the destination then fully becomes the source (endpoint + credentials, clearing any stale destination credential), with a warning printed. (#284)
Changed
magnetar-admin(AdminError): added a newAdminError::Decode { method, url, status, content_type, snippet, source }variant carried by the JSON decoders, and addedmethod: String+url: Stringfields to the existingAdminError::Statusvariant.AdminErrorstays exhaustive (no#[non_exhaustive]), so any exhaustivematchover it or anyStatus { code, body }destructure without..must be updated. The existingAdminError::Jsonvariant is now reserved for request-body encode failures only (its#[error]text changed fromjson decode: …tojson encode: …); response decode failures route throughAdminError::Decode. (#282)magnetar-admin(AdminError): added anAdminError::Auth(String)variant for OAuth2 token-acquisition failures. SinceAdminErroris exhaustive, downstream exhaustive matches must add this arm. (#281)
Fixed
- Admin client (
magnetar-admin): non-JSON admin responses now surface the request method, URL, HTTP status,Content-Type, and a truncated body snippet instead of the bareserde_jsonmessage (json decode: expected value at line 1 column 1). Hitting the wrong endpoint, a reverse proxy, or an auth-redirect on a 2xx is now self-diagnosing. Non-success statuses (AdminError::Status) also name the method + URL. (#282) - CLI (
magnetarctl) config/context correctness:context renamerefuses to overwrite an existing destination instead of silently destroying its endpoint + credentials (use--forceto opt in);context setno longer persists an inheritedMAGNETAR_TOKEN(only an explicit--tokenis written) and clears mutually-exclusive auth fields when switching auth mode so a stale higher-precedence credential cannot shadow the one just configured. (#281, #284)
Security
- CLI (
magnetarctl) credential safety: OAuth2 rejects a non-httpsissuer_endpointup front so theclient_secretis never POSTed over plaintext;AuthInfocarries a redactingDebugso a{:?}of the config never leaks the bearer token;config saveforces0600on a pre-existing world-readable config before writing credentials; an empty token-file token is rejected rather than sending a malformedAuthorization: Bearerheader to the broker; and the CLI warns whentls_allow_insecureis inherited from a context (silent verification downgrade). (#281, #284)
magnetar v1.0.1 — crates.io package rename
Changed
- Renamed the published crates.io packages to avoid a name collision (the
magnetarname is held by an unrelated, abandoned crate): the façade ships asmagnetar-driverand the CLI asmagnetarctl(binary commandmagnetarctl). The façade's library/import name is unchanged —use magnetar::*still works; only the dependency line differs (magnetar-driver = "1.0.1"). No API, behavior, or wire-format change. (ADR-0067)
magnetar v1.0.0 — first stable release
First stable release.
Magnetar is a from-scratch Apache Pulsar client driver for Rust with full Apache Pulsar Java-client parity, a sans-io protocol core, and two interchangeable runtime engines.
See the parity matrix for the per-feature status snapshot.
Added
- Initial public release of magnetar, a from-scratch Apache Pulsar client driver for Rust. Targets Apache Pulsar 4.0+ LTS, advertises CONNECT
ProtocolVersion::V21with downgrade fallback, and ships as a 12-crate workspace (façademagnetar, sans-io coremagnetar-proto,magnetar-runtime-tokio,magnetar-runtime-moonpool,magnetar-differential,magnetar-admin,magnetar-cli,magnetar-fakes,magnetar-auth-oauth2,magnetar-auth-sasl,magnetar-auth-athenz,magnetar-messagecrypto) plusxtask. (75f7c16) - Sans-io protocol core (
magnetar-proto): aquinn-proto-style pure state machine (handle_bytes/poll_transmit/poll_event/poll_timeout) for Connection, Producer, and Consumer, with zero I/O dependencies and injected clocks (now: Instant,wall_clockprovider). The same state machine drives both engines. (123b8db, 10cb025; ADR-0004, ADR-0011) - Dual runtime engines selected at the type level via
PulsarClient<E: Engine = TokioEngine>: a production tokio engine and a deterministic-simulation moonpool engine overmoonpool_core::Providers. The moonpool engine reaches full façade parity (driver loop + transport, Client lookup / partitioned-metadata / topic-watch, Producer send/flush/close, Consumer receive/ack/seek) plus a rustls-over-bytepipe TLS adapter. (405d2cd, 9555113, 1eba8e1, f59032f, e01d676, 3a119e7) - No-channels concurrency architecture: all
mpsc/broadcast/watch/oneshotand third-party channel crates are banned and replaced withArc<parking_lot::Mutex<…>>+tokio::sync::Notify+Wakerslabs. A split connection mutex enforces global→per-slot lock ordering so theProducer::sendhot path takes only the per-slot mutex. (3275b41; ADR-0003, ADR-0038) - Producer Java-client parity:
send/sendAsync, batching withbatchingMaxPublishDelayflush timer, message chunking (PIP-37, chunks-never-batched with bounded consumer reassembly cap), LZ4/ZSTD/Snappy/ZLIB compression,initialSequenceId,sendTimeout, producer access modes Shared/Exclusive/WaitForExclusive/Fencing (PIP-68), customMessageRouterwith Murmur3/JavaStringHash, an interceptor SPI,TypedMessageBuilder, and hdrhistogram p50/p99/max stats. Best-effortCloseProduceris sent on last-clone drop. (#243; ADR-0057, ADR-0063) - Consumer Java-client parity: Exclusive/Shared/Failover/Key_Shared subscriptions,
receive/batchReceive, the full ack family (individual/cumulative/batch/with-properties/under-txn) including batch-index ack (PIP-54/391), negative-ack withMultiplierRedeliveryBackoffand an ack-timeout tracker (PIP-37),reconsumeLaterretry-letter (PIP-58), dead-letter policy (PIP-22/58/124/409), seek by id/timestamp/earliest/latest and per-partition, pause/resume,readCompacted, key-shared sticky/auto-split/hash policy (PIP-34/119/282/379), subscription properties,replicateSubscriptionState, force-unsubscribe (PIP-313), andMessageListenerpush delivery across single/typed/multi-topic/partitioned/pattern consumers. (fe33784; ADR-0064) - Reader, partitioned producer/consumer, multi-topic, pattern (regex, PIP-145), and
TableViewsurfaces, all generic overE: Engine, withauto_update_partitions_intervaltickers for partition growth. (8cfd1e3, 844655b, fe5d8c0, b51680a, 31f9cbe, 2b7570c, f09f23c) - Transactions (PIP-31) end-to-end: a
TxnClientcoordinator with begin/commit/abort,ADD_PARTITION_TO_TXN/ADD_SUBSCRIPTION_TO_TXN, publish-under-txn, ack-under-txn, andEND_TXNcleanup; theTransactionsurface is engine-generic. (71e81e9, 19a8df5, ab9041b) - Schema layer with full Java parity: Bytes/String/JSON/Avro/Protobuf/ProtobufNative/KeyValue/AutoConsume (PIP-87 broker lookup)/AutoProduceBytes plus all primitives. AVRO/JSON are canonicalised via the broker canonical form (apache-avro 0.21); PROTOBUF_NATIVE and KeyValue output is byte-identical to the Java client. (f3eb61b, d265a06, 08f5702)
- Authentication provider parity: Token, mTLS, OAuth2
ClientCredentialsFlowwith token caching, SASL-PLAIN (RFC 4616), SASL-Kerberos vialibgssapimulti-roundAUTH_CHALLENGE, and Athenz (pre-fetched role token plus opt-in ZTS round-trip). In-bandAUTH_CHALLENGEcredential refresh implements PIP-30/PIP-292. (48a65b4, 122298e; ADR-0014, ADR-0029, ADR-0030, ADR-0041) - Pluggable rustls crypto providers selected at compile time on the façade:
crypto-aws-lc-rs(default, post-quantum hybrid key exchange),crypto-ring,crypto-openssl(rustls-opensslwrapper), andcrypto-fips(aws-lc-fips-sys). rustls-only — no native-tls. (3f392af, b6f9cbe, closes issue #9; ADR-0005, ADR-0035) - End-to-end message encryption (PIP-4,
magnetar-messagecrypto): AES-GCM payload encryption with RSA-OAEP key wrapping,MessageEncryptor/MessageDecryptortraits on producer and consumer, andcryptoFailureActionFail/Discard/Consume wired end-to-end, including a moonpool message-crypto bridge. (1bfc7e3, 6039251; ADR-0044) - Admin REST client (
magnetar-admin, reqwest + rustls) and a kubectl-stylemagnetarCLI: namespace/topic policy endpoints (retention, backlog-quota, TTL, persistence, dispatch-rate, dedup, compaction, delayed-delivery, max-producers/consumers/unacked), schema registry, rack-aware brokers/bookies, Functions/Sources/Sinks/Packages, subscription ops, and PIP-415getMessageIdByIndex. (d315c20, d26028b) - Resilience: supervised reconnect with
Connection::resetand transparent producer/consumer rebuild, keepalive watchdog, terminal fast-fail, lookup-retry on session-lost, ack-gated re-attach replay, and a handshake-failure budget. Memory limit withFailImmediatelyatomic CAS and aProducerBlockWakerslab, cluster failover (PIP-121ServiceUrlProvider, Controlled/Auto), andTOPIC_MIGRATEDsupervised reconnect (PIP-188). (#263, 5dcc6f9, 6013320; ADR-0016, ADR-0017, ADR-0018, ADR-0020, ADR-0028, ADR-0060, ADR-0061) - Additional PIPs: broker-entry metadata (PIP-90), shadow topics (PIP-180 — admin CRUD, producer
send_with_source_message_id, consumerMessageReceivedFromShadow), and replicated subscriptions (PIP-33 —replicate_subscription_statefield plus marker filter, with a two-cluster e2e fixture). (bc7ea94, 01d0afd; ADR-0033, ADR-0034) - Experimental, default-off surfaces: PIP-466 V5 client (
magnetar::v5behindexperimental-v5-client, wraps v4 with no wire change) and the PIP-460 scalable-topics scaffold (behindscalable-topics:topic://URLs, DAG watch,StreamConsumer,magnetar topic-info). No released broker ships PIP-460. (b3c581e, d3684ac; ADR-0031, ADR-0032) - Observability and proxy support: OpenTelemetry context propagation behind the
opentelemetryfeature (auto-injectstraceparent/tracestateinto message properties at the send boundary), and Apache Pulsar Proxy support via a per-broker connection pool with lookup-driven routing. (#151, #17; ADR-0039, ADR-0053) - Structured logging across the driver: every error/warn/info log carries at least one structured field (xtask-enforced), with subscriber-side rate-limiting/sampling guidance. (#218, #280; ADR-0054, ADR-0065)
- Cross-runtime test and coverage policy: every behavioral change ships proto-unit + tokio-integration + moonpool-integration + differential-equivalence + e2e tests, with 100% moonpool patch coverage and a strict 1:1 tokio↔moonpool test count, all xtask-gated. The deterministic-simulation harness adds buggify fault injection, swizzle-clog workload, bit-flip survivability, and a seed sweep. (0c8c26c, fec933b; ADR-0024, ADR-0036, ADR-0048, ADR-0050, ADR-0055)
Changed
- Migrated to Rust Edition 2024 and raised the MSRV to 1.88. (ADR-0007, ADR-0042)
- Refactored the client façade into dedicated
builders.rs/client_builder.rsmodules. (9b83a00, a69830c) - Repinned the moonpool dependency to the published crates.io 0.7.0 (from a floating git dependency) and adopted vectored writes. (#242, 6a0e24b; ADR-0043, ADR-0056)
- Bumped runtime dependencies:
libgssapi0.7.2→0.9.1,http1.4.0→1.4.1, andrcgen0.13.2→0.14.8. (#13, #152)
Removed
- Removed dead scaffolding and consolidated the crypto traits into
magnetar-proto. (2a07f07) - Removed
tls_trust_certs_file_pathfromClientBuilder. (1736be8) - Dropped the earlier multi-step (0.1.0 / 0.2.0) release-planning artifacts, superseded by this single 1.0.0 release. (fd6e62d)
Fixed
- Pre-release audit correctness fixes: decompression-bomb size cap,
Instant-overflow guard, partition-hash correctness, and multi-topic receive starvation. (#279, 9347c39) - Closed transaction parity gaps so the transactions e2e suite passes. (19a8df5)
- Hardened consumer behavior during seek and across transient broker-close, and fixed partitioned-topic auto-detection on topic delete. (issue #65, 780349c, 6ec47a1)
- The ack-timeout tracker now drops nacked message ids to prevent double redelivery. (7ce5e25)
- Resolved moonpool deterministic-simulation seed-sweep failures and hardened swizzle seed replay. (#244, #262, #264)
- The reconnect supervisor now persists its backoff across reconnects and resets only after the drop-grace window is stable. (#16)
Security
- Secrets are redacted from
Debugoutput: passwords and private keys (CWE-532), Athenzprivate_key_pem, andAdminAuth::Token, each guarded by secret-scan log-capture tests. (3406f7d, e92994e, f5ae060, 28711ef) - All
panic!anddebug_assert!calls are removed frommagnetar-protoproduction paths; every path returnsResult/Option. (a561203, cac2199) - CRC32C verify-or-drop on frames with magic
0x0e01: a checksum mismatch emits aChecksumMismatchevent and drops the frame. - Exposed
tls_allow_insecure_connectionand `tls_hostname_v...