-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding mutable metadata and cluster id #803
Conversation
schema/mysql/v57/temporal/versioned/v1.1/mutable_cluster_metadata.sql
Outdated
Show resolved
Hide resolved
schema/postgresql/temporal/versioned/v1.1/mutable_cluster_metadata.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz also add corresponding tests here:
https://github.com/temporalio/temporal/blob/master/common/persistence/persistence-tests/clusterMetadataManagerTest.go
There was a problem hiding this 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
…ng it instead of immutable metadata
6fdec9b
to
9e0b8b1
Compare
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.