Skip to content
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

Make it possible to get and set superseding schema info #130

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

spenes
Copy link
Contributor

@spenes spenes commented Mar 28, 2023

Details are in #129

Copy link
Contributor

@istreeter istreeter left a comment

Choose a reason for hiding this comment

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

This looks great.

I wondered if some of this should be implemented in iglu-scala-core instead of iglu-server. For example, the deserializers and serializers. Maybe the definition of SelfDescribingSchema needs to change? Might we need to use similar serializers/deserializers in igluctl?

But I'm also fine to merge this as-is, and then tackle it in iglu-scala-core at another time, only if needed.

body JSON NOT NULL
body JSON NOT NULL,

supersededby VARCHAR(128) NULL
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nit, but superseded_by (with underscore) is more in-keeping with the other column names.

for {
existing <- db.getSchema(schema.self).map(_.isDefined)
_ <- if (existing) db.updateSchema(schema.self, schema.schema, isPublic)
else db.addSchema(schema.self, schema.schema, isPublic)
_ <- updateSupersedingVersion(schema.self, s)
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you considered what happens if addSchema is successful but updateSupersedingVersion is unsuccessful? It struck me that nothing runs inside a transaction.

I'm not saying this is a problem. Please just confirm the database can't end up in an inconsistent state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case, it would be like superseding info wasn't submitted at all. I don't think it would lead to inconsistent state.

@spenes
Copy link
Contributor Author

spenes commented Mar 29, 2023

I wondered if some of this should be implemented in iglu-scala-core instead of iglu-server. For example, the deserializers and serializers. Maybe the definition of SelfDescribingSchema needs to change? Might we need to use similar serializers/deserializers in igluctl?

I thought about it but I couldn't be sure if we should do it or not since SelfDescribingSchema is used in a lot of places but supersededBy field will be only used by Enrich. I thought it might better to leave it as local as possible. I would vote to leave it like that for now. We can revisit while working on Igluctl for superseding schema feature maybe.

@spenes spenes merged commit d899557 into develop Apr 17, 2023
@spenes spenes mentioned this pull request Apr 17, 2023
@istreeter istreeter deleted the schema-override branch July 25, 2024 21:00
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.

3 participants