Skip to content

Conversation

@vitarb
Copy link
Contributor

@vitarb vitarb commented Oct 6, 2020

This change allows us to have have unique stable cluster id stored in the database and also provides ability to store any other cluster specific data alongside without having to fear that we will override immutable data.
It also allows changing mutability of certain fields in code when needed.

Previously all cluster metadata was immutable containing only cluster name (from the config) and shard count. This limited its usability as it was impossible to add new fields (e.g. cluster id) to it as well as store mutable components like latest available version.

In the first attempt I've tried to add another blob alongside immutable metadata but quickly realized that keeping it would result in messy code due to lack of clear boundary between mutable and immutable.
As a result I've decided to refactor existing implementation and move immutability check on application layer at the same time adding versioning to the storage.

Change was tested locally using persistence test and manually on cassandra/mysql.

@vitarb vitarb requested review from alexshtin and mastermanu October 6, 2020 05:17
Copy link
Contributor

@wxing1292 wxing1292 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@wxing1292 wxing1292 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz add some tests before landing

@vitarb vitarb removed the request for review from mastermanu October 8, 2020 00:08
@vitarb vitarb force-pushed the version-info-boilerplate branch from 6fdec9b to 9e0b8b1 Compare October 8, 2020 00:20
@vitarb vitarb merged commit b63d577 into temporalio:master Oct 8, 2020
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.

3 participants