hn.today

Rolling upgrades in tellus: old code cannot learn a new shape

heikoseeberger.de6 points0 comments
Screenshot of Rolling upgrades in tellus: old code cannot learn a new shape

Rolling upgrades in tellus require old and new nodes to exchange messages while each understands a different data shape. Because postcard encodes values in order without field names, an old node may reject a changed message or, worse, decode it into an incorrect value. Old deployed code cannot be taught the new format, so updated code must bridge both ways. Nodes announce their application versions to peers, and each transmitted payload carries a schema version. Unchanged types can use the default schema behavior; changed types must explicitly handle supported versions, while unknown versions are rejected and logged as dead letters rather than silently misread.

The cluster demo illustrates this with Pong, which gained an application-version field. New nodes convert old Pong messages into the new shape, filling the added field with None, and send the old shape to peers running an older major version or whose version is unknown. Supporting both conversions allows a single rolling upgrade and also makes rollback safer; without the outgoing conversion, deployment would require two separate releases. The design avoids treating arbitrary containers such as Vec<Pong> or Result as schema-versioned types, because a single outer version could bypass checks for changed elements. One limitation is that messages encoded before a peer connects use the oldest supported shape. Chaos tests rolled five nodes between application versions 1.0.0 and 2.0.0, checking each rollout and rollback stage without finding violations.

Read on heikoseeberger.de0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Show HN: Rust Commander

Show HN: Rust Commander

Rust Commander is a Rust terminal file manager modeled on Midnight Commander, with dual-pane navigation, a persistent shell, archive and remote browsing, and background file operations. Version 0.3.1 adds file-change alerts, viewer copy controls, customizable skins, and faster SFTP previews and copying. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.