Skip to content

Magazine 2.0.0 - #11

Merged
MISBMS merged 13 commits into
mainfrom
optimisations
Sep 8, 2026
Merged

MISBMS merged 13 commits into
mainfrom
optimisations

Conversation

@tshan10

@tshan10 tshan10 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

What

  • fire() rewritten as a single guarded atomic increment instead of read-then-compare-and-swap.
  • Distributed Lock Manager removed: dedupe now uses a single Aerospike CREATE_ONLY write; DLM and its transitive graph (hbase-shaded-client, log4j 1.2.17, compile-scoped junit 4.12) are gone.
  • Guava removed: replaced with a hand-rolled retry loop.
  • Micrometer metrics added, on by default, no wiring required: a storage built without a meterRegistry publishes straight to Micrometer's global registry out of the box.
  • magazine-dw-bundle moved to Dropwizard 5.x (jakarta): bridges the global registry to the application's admin-port metrics.
  • CPU work hoisted off the hot path: filter expression, write policies and metadata keys are now built once instead of per call.
  • Shard/hole-skip/dedupe defaults reworked: shards 64→8, new activeShardRefreshSeconds / metadataCacheSeconds, maxFireContentionAttempts removed.
  • Package layout, error codes, and Storage SPI reshaped (common/scope/util → entity, initialize() returns MagazineContext, RETRIES_EXHAUSTED split from NOTHING_TO_FIRE).
  • Build hygiene: maven-enforcer + license-maven-plugin added, jacoco/gpg bumped, dead maven-release-plugin config removed, plugin-version pinning for reproducibility.
  • Test suite split and de-flaked: 1081-line MagazineTest broken into 7 focused classes; AerospikeTestContainer fixed for static-mutable init and per-test client leaks.
  • Docs rewritten: upgrading.md, metrics.md, delivery-semantics.md added/corrected against the real 1.x source and a real consumer (ignisMQ).

Why

  • The old claim was read-then-CAS: every concurrent consumer read the same pointer and all but one failed, so Aerospike round trips per dequeue scaled with consumer count, the single biggest cost driver under load.
  • DLM added a coordination round trip and a heavy dependency tree for a job CREATE_ONLY already does atomically; dead weight once recognized.
  • Without instrumentation, "round trips per dequeue" was an assertion, not a fact, the whole 2.0 performance story needed a way to measure it, not just claim it.
  • The bundle needed jakarta/DW5 to keep pace with the platform DW5 migration; the old javax-based bundle had no path forward.
  • MagazineTest's size and the test container's shared static state were actively hiding bugs (a test was asserting against another test's magazine by accident) and leaking Aerospike client threads across the suite.

Impact

  • Aerospike calls per fire() are now flat at 3 regardless of consumer count (claim, read payload, advance counter) — previously this scaled with the number of competing consumers.
  • Runtime dependency graph cut to 4 artifacts: aerospike-client, caffeine, slf4j, micrometer-core. No more hbase, log4j 1.x, or Guava on the classpath.
  • Breaking release: package moves, SPI signature changes, and the RETRIES_EXHAUSTED/NOTHING_TO_FIRE split all require consumer-side changes; upgrading.md is the required reading, and its checklist is the migration path.
  • Bundle users on Dropwizard 5.x get metrics on the admin port with zero configuration; anyone still on Dropwizard 2.x/3.x (e.g. ignisMQ) cannot adopt magazine-dw-bundle and must consume magazine-core directly.
  • Existing production magazines are unaffected by the shards default change: persisted shard count remains authoritative; only newly created magazines get 8 instead of 64.

@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

@MISBMS
MISBMS merged commit e018807 into main Sep 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants