Skip to content

v5.0.1

Choose a tag to compare

@Ahoo-Wang Ahoo-Wang released this 16 Nov 09:49
38c6218

CosId 5.0.1

A patch release of CosId 5.0 (tag v5.0.1; the Docker image is tagged 5.0.1, 5.0 and latest). It fixes the 43
bugs a review of 5.0.0 found (#1433–#1480) and one found while fixing them (#1489), and updates dependencies. The Java
API, the cosid.* configuration and the storage formats are unchanged; a few fixes reject or report what 5.0.0 accepted
and got wrong, listed first.

CosId 5.0 的补丁版本:修复了对 5.0.0 审查发现的 43 个缺陷(#1433–#1480)以及修复过程中发现的 1 个(#1489),并更新了依赖。
Java API、cosid.* 配置和存储格式不变;少数修复会拒绝或报告 5.0.0 曾接受却处理错误的情况,见下文"升级须知"。

Released: 2026-11-16.

Upgrading from 5.0.0

Most fixes need nothing. These change what an application or an operator sees:

  • ModCycle range routing (#1451): a range without a lower bound (lessThan, atMost) visits every node, since
    negative values route to nodes too; 5.0.0 started such a range at 0 and missed the nodes of negative values.
  • The node collections of a Sharding are read-only (#1459): remove and clear throw
    UnsupportedOperationException, like the other mutators. They are often the algorithm's own effective nodes or a
    cached range, shared by every caller; copy one to change it.
  • range-ttl below 1 ms is rejected at start-up (#1444): the generator's clock counts milliseconds, and 5.0.0
    silently turned it into no time to live.
  • IdFiller picks the setter of the most specific type (#1466); two setters of incomparable types (such as
    Number and Comparable) are an explicit ambiguity error instead of whichever reflection listed first.
  • cosid-server: an endpoint of the API listed in cosid.server.auth.public-paths now serves every caller as
    anonymous (unrestricted), whatever token it sends (#1435); 5.0.0 answered 400 to every call.
  • cosid-migration config writes nothing for a 4.x configuration it cannot convert equivalently and says which
    4.x setting to change: zero-padded decimal text with char-size below 19 (#1463), and a CosIdGenerator whose bits
    fit a long (#1473). plan takes --group-locale for group keys whose pattern has text such as MMM (#1480), and
    records it in plan.json.

Fixes

Core (#1483, #1489)

  • Radix.maxWidth rejects a radix outside [2, 62]; @AsString(radix = 1) hung the serializing thread (#1441).
  • A static slot's window is extended when System.nanoTime() is negative; it was read as a back-off (#1454).
  • held() (and describe(), cosid.segment.held) leaves out ready ranges past their time to live (#1474).

Sharding (#1482)

  • ModCycle no longer overflows at Long.MAX_VALUE (#1434), and computes BigInteger and BigDecimal ranges without
    truncating them to a long (#1452).
  • IntervalTimeline leaves out an interval that an open upper endpoint excludes entirely (#1440).
  • StandardLocalDateTimeConvertor converts a JDBC java.sql.Date by its date (#1453).
  • ExactCollection.toArray(T[]) fills an array that is large enough (#1458).

Spring Boot (#1485)

  • Only the stores the runtime opens get a client bean: a store of disabled generators needs none (#1455).
  • A store without client finds the single or primary bean in an ancestor context too (#1476).
  • A singleton or alias holding a generator's name fails the start instead of being replaced (#1475).
  • preferred-slot: ${POD_ORDINAL:} without the variable (#1470) and a profile's codec: [] (#1450) are no unknown keys.
  • The Spring Data Redis adapter reads options.WAIT as wait (#1479); a static master/replica Lettuce factory gets the
    adapter, as its native client cannot connect on its own (#1445).

Jackson and cosid-server (#1484)

  • @AsString ids carry a @JsonTypeInfo type id (#1460); a long's null and empty text follow
    FAIL_ON_NULL_FOR_PRIMITIVES (#1439).
  • The periodic id endpoint counts what it issues in cosid.generator.generated (#1467).

Stores (#1487, #1464, #1489)

  • The remote store bounds the whole call, its response body included, by requestTimeout (#1438).
  • The Redis Cluster path with replicas to wait for follows MOVED and ASK (#1437).
  • A store timeout below 1 ms no longer becomes "no timeout" in MongoDB (#1461) or Redis WAIT (#1489).

cosid-migration (#1486, #1447)

  • The 4.x configuration is read as Spring binds it: texts keep their blanks (#1456), on/yes/1 are true (#1468),
    dotted generator names in brackets are kept (#1446).
  • The codec list follows the 4.x converter chain (#1478); the fetch plan auto is statement (#1472); a store timeout
    above 3 s raises the generators' reserve-timeout (#1462).
  • Group keys are reformatted by the fields they hold, not by letters of quoted text (#1457).
  • plan reads the store clocks without writing; with ZooKeeper it estimates W and says so (#1469).

Build and benchmark harness (#1481, #1488)

  • A failed JMH run, a missing release-gate group, a unit change or a broken Gradle run is never reported as PASS
    (#1433, #1436, #1442, #1443, #1465).
  • The plain-Java store consumer is checked outside the build, on the published metadata (#1471).

Dependencies

Lettuce, the MongoDB driver, ZooKeeper, HikariCP, JUnit and Gradle 9.9.1, among others (#1425–#1432, #1448, #1477,
#1490, #1491, #1493, #1494).

Release evidence

  • CI green on the release commit, the published jars in Maven and Gradle applications on Spring Boot 4.1.2 and in a
    plain-Java consumer without a BOM (CI job published-jars).
  • No release gate run: no change touches an ID generation path the gate measures; the changed store paths (Redis Cluster
    redirects, the remote client's deadline) change failure handling only.