If Apache Iggy is useful to you, give it a star on GitHubStar apache/iggy
Skip to Content
Apache Iggy
Server
These docs describe the upcoming release. They follow the master branches of apache/iggy and apache/iggy-connectors. For the last release, read the 0.10 release docs, or select a version at the top of the sidebar.

Upgrading from 0.9 to 0.10

Prepare a fresh data directory, matching clients and updated configuration for Apache Iggy 0.10.0.

Apache Iggy 0.10.0 changes the wire protocol, data directory format and public SDK APIs. Upgrade the server and clients together.

Preserve data before the upgrade

There is no migration from a 0.9.x data directory. Keep a backup and export messages that you need with the old server and compatible clients. Start 0.10.0 with a separate, empty data directory. Import the retained data through a compatible client. Do not point the new server at the old directory.

Stop all 0.9 nodes before starting the 0.10 cluster. See Release compatibility for later upgrades. Keep the old deployment and its data available until you finish the cutover checks.

Upgrade clients and tools

Server 0.10.0 uses client protocol 0.12.2. The server rejects incompatible binary clients at login. Use the versions in Server compatibility. The 0.9 documentation remains available for the old deployment.

Review API changes before recompiling applications. Resource creation uses typed options. Updates change only the fields supplied through set/reset patches. Stream and topic purge, flush unsaved buffer, and the old UpdateStream, UpdateTopic and UpdateUser wire commands are removed. The SDK update methods use UpdateResource internally.

Rust stream builders take stream and topic names, without caller-assigned IDs. Python requires Python 3.11 or later. The SDK guides describe the release APIs and examples.

Review server configuration

Compare your configuration with the 0.10 reference. Do not copy obsolete keys into the new deployment.

  • Set IGGY_ROOT_USERNAME and IGGY_ROOT_PASSWORD before first boot. The server no longer generates a root password. Use --with-default-root-credentials only for development.
  • Remove consumer_group.session_timeout. Session expiry derives from heartbeat.interval with a factor of 1.2. consumer_group.heartbeat_interval controls membership heartbeat pacing.
  • Replace user_id with username in http.jwt.trusted_issuers. The mapped account must exist and cannot be root. HTTP clients and the Web UI must log in again because old self-issued access and refresh tokens are rejected.
  • Supply a valid logging.level. An invalid filter stops startup. Log files rotate by size, with retention and total-size cleanup.
  • Keep cluster.coordinator.replica_connections_per_peer identical on all nodes. Cluster membership is limited to 32 nodes.
  • Keep node clocks synchronized. Authenticated HTTP forwarding uses short-lived proofs.

New topics inherit cluster.default_replication_factor, which defaults to all. Select a different factor at topic creation with replication_factor. Existing topics retain their stored value. See Multi-leader partitions.

Review consumer checkpoints

A checkpoint records how far a consumer processed a partition. The current poll API defaults to manual commits. Rust high-level consumers also default to manual commits, and the stream builder starts with PollingStrategy::next().

Store offsets after processing, or select an explicit automatic commit policy. Without stored offsets, a restarted consumer can read retained messages again. Committing on read can advance the offset before application processing. See Deferred polling.

Connector sinks use deferred polling. Replace poll_interval with max_wait and min_count. The runtime rejects a sink configuration that still sets poll_interval.

Review encryption

Encryption is selected when a stream is created. Each encrypted stream has its own data key. Enabling server encryption does not encrypt an existing unencrypted stream. Keep all keys required to read retained streams and backups. See Stream options for key creation and rotation.

Edge builds after 0.10.0

The replica wire revision 4 build of server 0.10.1-edge.2 introduced storage marker IGGY-TIERED-SEGMENT-CHAIN-2. When moving from an older marker, start every node with a fresh, empty data directory and upgrade all nodes together, as for 0.10.0. Access tokens issued before the credential change are refused, so HTTP clients and the web UI sign in again.

That build also changes what revokes a credential. A password change ends every session of the account except the binary session that submitted it, and refuses every access token issued before it. Deactivating an account deletes its personal access tokens, so issue new ones after reactivation. Deleting a personal access token, or its expiry, ends the sessions opened with it. Stream and topic lists return only the entries the caller may read. See Security.

Later builds with the same 0.10.1-edge.2 version use replica wire revisions 5, 6 and 7. Revision 6 replicates the read cache options of topics and shadow topics and the persisted consumer offset durability of geo topics. Revision 7 adds the replicated RollSegment operation. Server 0.10.1-edge.3 uses revision 8, which replicates the admission of nodes joining a running cluster. To move from revision 4, 5, 6 or 7 to a later revision, stop every node, keep its existing data directory and restart the cluster on the new build.

Revision 8 writes metadata snapshot format 22. Revisions 6 and 7 cannot restart from a directory containing that snapshot or a metadata WAL containing a committed admission or bind (operations 77 and 78).

External Rust implementations of ClusterClient must implement the four new membership methods when upgrading.

Storage marker IGGY-REVISION-CHECKSUMS-1 replaces IGGY-TIERED-SEGMENT-CHAIN-2 in later builds. Nodes with different markers refuse each other, so stop every node, keep its data directory and restart the cluster on the new build. The first start replaces the marker, and older builds then refuse the directory. To be able to roll back, copy the complete data directory of every node after you stop the cluster and before that first start. A rollback restores the copies on all nodes and starts the old build. Everything written after the copy is lost.

Release compatibility

Run the same server build on every node unless one stable release explicitly lists the other in its compiled compatibility table. The table currently lists no pairs. Edge builds can have the same version string and different replica wire revisions. An identity mismatch produces incompatible_build.

The startup log entry replica handshake identity reports release, client_protocol, replica_wire_revision, storage_format and compatible_releases. The last field lists the other releases this build declares compatible.

For a listed pair, verify that the client protocol, replica wire revision and storage marker match. If a peer-dependent default changes, explicitly configure a value supported by both releases on every node before replacing the first binary. Add iggy.sim=debug to the existing log filter on each node before the upgrade. For example, info,iggy.sim=debug keeps the link installation messages and also logs partition commits.

Replace one node at a time. Record the metadata and partition operations below before stopping the node, so you have a reference even if it restarts as primary. After it restarts, wait for all of the checks below to pass before replacing another node.

  • Look for a replica link installed log entry for each peer and each configured link. The replica field identifies the peer and link identifies the link.
  • Send an authenticated GET /streams?limit=1 directly to the metadata primary and record the iggy-applied-op response header. After restart, refresh the reference if another node is primary. Repeat the request directly against the restarted node until its header reaches at least the recorded value.
  • For each hosted partition, use OperationCommitted events with plane="partitions" in the iggy.sim logs. Record the primary's namespace_raw and op. Wait for the restarted node to log an op at or above the recorded value in that namespace. If the partition is idle, an acknowledged write lets you observe a fresh commit.
  • Inspect storage.revision with od -An -tx1 -j8 -N8 local_data/storage.revision. Wait until its eight bytes are no longer all ff. The node logs Metadata replica <id> left storage recovery in view <view>. shortly before it writes the revision.
  • While the record is pending, look for Node <id> waits for nodes [..] in the local log. Check the named nodes and their replica links. If the peers answered but the proof could not be written, the local error is Cannot record the storage proof of this node. The metrics endpoint becomes available once verification succeeds.
  • Wait until both partitions_awaiting_load and partitions_storage_recovering read 0 on every shard. Partitions load in batches after metadata recovery. The first gauge counts copies awaiting load and reads -1 when the initial inventory is still unknown. The second counts mounted copies in recovery.
  • Check partitions_untrusted_log for groups waiting for trusted history. Search each peer's log for partition_refused and the namespace. A refused copy stays unmounted and does not appear in the mounted recovery gauges. A recovered copy logs Partition <id> of topic <id> in stream <id> left storage recovery in view <view>.

A restarted node votes and acknowledges again in a group only after the other voters of that group answered it: the metadata group and every replicated partition it hosts. A disk with valid checksums can still hold an older copy, and their answers rule out a newer view it no longer remembers. A voter with a mounted copy registers the restarted node's new boot before answering. From then on it refuses any DoViewChange the node sent before the restart.

It needs every other voter of the group, both of them in a group of three. Until then, stopping another voter of a three-voter group leaves that group without a quorum until one of the two returns.

The groups are the metadata group and every partition replica set, and the metadata group comes first: a restarted node opens none of its partitions until every other metadata voter answered, even partitions whose replica set does not include the absent node.

With three nodes and one down, a crash or restart of a second node leaves the metadata group, and every partition stored on those two nodes, without a quorum until the first returns or is retired. Earlier releases resumed such a node from the live primary's StartView.

A refused copy cannot vote or acknowledge. It can answer a restart probe with its verified durable view, or the creation view if the superblock is absent, checksum-damaged, foreign or in an unknown format. An I/O error reading a replicated copy is retried before it can answer. A singleton with unreadable superblock files stays offline while the rest of the node boots.

An election needs two of two voters, two of three, or three of four. In a group of two, a refused copy alone blocks an election. In a group of three or four, a refused copy and one more unavailable voter block it.

A copy marked with history.pending reports whether the partition predates this disk. Once every voter has answered, the group can start fresh if none holds an initialization record and fewer than a replication quorum report that their disk may have replaced an earlier copy.

A copy that still waits for a transfer, marked or not, also says that it cannot serve its history yet. That only tells the primary to serve the empty partition when nothing committed and too few other copies hold it, and never counts toward a fresh start.

A placeholder vote from a marked copy also counts less against the view-change cap, because one storage fault leaves at most one such voter that acknowledged before it lost its storage. The claim stays true while the vote counts: a replica acknowledges nothing in a view below one it voted in, and a vote from an earlier life of a node stops counting once its next life registers.

A marked copy can answer a view change that then aborts, and finish its transfer in the old view. It then refuses every acknowledgement there and flags its heartbeat replies. The primary excludes replies flagged ACKS_FENCED from its heartbeat quorum, so when too few copies can acknowledge to commit a write, it steps down, and the next view change lets those copies acknowledge again.

Use the namespace and cause logged with partition_refused. For an I/O failure, restore access to the files and restart the node. For a damaged partition superblock in a replicated group, verify that a peer holds the current history, stop the affected node, move its partition directory aside and restart it to rebuild. Keep the original files until the copy catches up. For a damaged initialization record, restore <system>/partition-initialization/<namespace>/created.revision from a verified backup of this disk and incarnation. For a damaged created.revision in the partition directory, stop the node, copy that initialization record over it and restart the node. For a damaged retirement fence, restore retirement.fence from the same directory and backup. For a damaged history.pending in that directory, move it aside and rebuild the partition as for a damaged superblock. A valid fence keeps a retired incarnation offline. If the retirement status is unknown, keep the copy offline until you establish it. A singleton with lost data needs a backup to recover its messages.

Nothing in this release removes a voter. If one never returns, replace it in place before any other voter restarts: start a new machine with the same node ID and replica address, an empty data directory, root credentials and the cluster secret. Its empty disk counts as lost storage, so it rejoins like a node started with --fresh: the other voters answer it, and it refills by transfer.

If a second voter already restarted and waits for the lost one, restart the waiting voter with --lost-voter <NODE_ID>. Every other live voter retires that node only while its own replica link to it is down and the voters left still form a view-change quorum, and records it in retired.nodes in the data directory before it answers. Once all of them did, the waiting voter rejoins without it. See Retire a lost voter.

Retiring a voter gives up history. In a three-voter group the lost voter and the restarted voter may have been the only two to acknowledge an operation, and if the restarted disk rolled back, that operation is gone. Every voter then refuses the retired node until it restarts with an empty data directory, so its old disk can never bring back a history that conflicts with what the group committed since. Its log says that it was retired and asks for its data directory to be emptied.

In a group of five or seven, never restart or replace a second voter while another one is down, and a crash counts as a restart. With five voters and one down, a restarted voter waits for the absent one, the three that remain are exactly the quorum, and losing one more stops writes until the absent voter returns. With seven voters and one down, a restarting voter leaves five, exactly the view-change quorum, so the next primary failure stops the group.

Apply the new default after every node has rejoined. For a larger metadata.journal_slots value, increase it on the backups one at a time, then on the metadata primary.

Later builds of 0.10.1-edge.2 add a read_cache field of type TopicReadCache to the Rust SDK's TopicCreateOptions and TopicUpdateOptions. A struct literal that names every field of either one stops compiling. Add read_cache: TopicReadCache::default(), which leaves both settings to each node, or end the literal with ..TopicCreateOptions::default() or ..TopicUpdateOptions::default(), so that a later field needs no change either.

A pattern that destructures every field of TopicResolvedOptions adds read_cache or .. the same way.

Check the cutover

Run producers and consumers against the new deployment before moving application traffic. Test resource creation, permissions, message payloads and headers, checkpoints, and reconnects. For a cluster, also test requests to different partition primaries and node failure. An accepted write and a processed message are different events. Select the required durability policies and commit behavior explicitly.

On this page