-
Notifications
You must be signed in to change notification settings - Fork 580
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
[v23.1.x] Schema Registry: GET /schemas/ids/<id> should return references #11240
Merged
BenPope
merged 6 commits into
redpanda-data:v23.1.x
from
BenPope:backport-pr-11216-v23.1.x
Jun 7, 2023
Merged
[v23.1.x] Schema Registry: GET /schemas/ids/<id> should return references #11240
BenPope
merged 6 commits into
redpanda-data:v23.1.x
from
BenPope:backport-pr-11216-v23.1.x
Jun 7, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will make the next refactor slightly easier. Signed-off-by: Ben Pope <ben@redpanda.com> (cherry picked from commit f917875)
This will make the next refactor slightly easier to comprehend. Signed-off-by: Ben Pope <ben@redpanda.com> (cherry picked from commit 4972bcc)
Signed-off-by: Ben Pope <ben@redpanda.com> (cherry picked from commit 5d5072b)
This should be a pure refactoring. The store has two mappings: 1) `schema_map`: Schema ID to Schema (sharded across cores) 2) `subject_map`: Subject-Versions to Schema ID Each of these mappings are then split across shards, coordinated by sharded_store. Prior to this change, references were attached to the Subject-Versions. This is an incorrect modelling; Schema should own the references to other schema. This commit does that refactoring by moving references from `typed_schema` to `typed_schema_definition`. There are a couple of things that are not straightforward: 1) `ValidSchema` (`protobuf_schema_definition`, `avro_schema_definition`) are the respective library instantiations of the representation, and are unable to reproduce their references to form a `canonical_schema_definition`, so references are stored inside the wrappers. 2) `referenced_by` and `is_reference` now require two phases to obtain the references, due to the sharded and diconnected nature of the two mappings (schema, and subject-versions). a) Obtain a list of schema ids that reference the subject-version b) Filter that list by subject-versions that are not soft-deleted Signed-off-by: Ben Pope <ben@redpanda.com> (cherry picked from commit 2fc2dfe) Conflicts: compatibility_protobuf.h due to 5a76733 store.h due to a376f21
Signed-off-by: Ben Pope <ben@redpanda.com> (cherry picked from commit c13d874)
`GET /schemas/ids/<id>` now returns its references. Fixes redpanda-data#11194 Signed-off-by: Ben Pope <ben@redpanda.com> (cherry picked from commit 9298788)
BenPope
added
area/schema-registry
Schema Registry service within Redpanda
and removed
area/redpanda
labels
Jun 6, 2023
CI Failure:
|
michael-redpanda
approved these changes
Jun 7, 2023
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.
Checked the two files that had conflicts, lgtm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/schema-registry
Schema Registry service within Redpanda
kind/backport
PRs targeting a stable branch
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of PR #11216
Fixes #11237,