Skip to content

HDDS-14337. Fix SCM startup failure near year boundary when seeding localId. - #11184

Draft
SaketaChalamchala wants to merge 1 commit into
apache:masterfrom
SaketaChalamchala:HDDS-14337
Draft

HDDS-14337. Fix SCM startup failure near year boundary when seeding localId.#11184
SaketaChalamchala wants to merge 1 commit into
apache:masterfrom
SaketaChalamchala:HDDS-14337

Conversation

@SaketaChalamchala

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

SCM can fail to start when it is first deployed near a year boundary (e.g. Dec 31). During the one-time migration to SequenceIdGenerator, SCM seeds an initial localId and requires it to be strictly greater than any ID the legacy UniqueId generator could have produced.
The seed was computed using LocalDate.of(LocalDate.now(ZoneOffset.UTC).getYear() + 1, 1, 1).toEpochDay()) (JVM local timezone), while UniqueId.next() uses System.currentTimeMillis() (UTC).
Near year boundaries these can disagree — for example, Dec 31 evening in US timezones while UTC is already Jan 1 — causing Preconditions.checkArgument(localId > UniqueId.next()) to fail and SCM startup to abort.

This proposed change computes the initial localId from the UTC calendar year as well.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14337

How was this patch tested?

Unit Test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant