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

Artifact transits to disabled state after last version is being disabled #5114

Open
dpilin opened this issue Sep 3, 2024 · 1 comment
Open

Comments

@dpilin
Copy link

dpilin commented Sep 3, 2024

Description

Registry
Version
: 2.6.2.Final
Persistence type: SQL

Environment

Kubernetes 1.26

Steps to Reproduce

  1. Create a new artifact in schema registry
  2. Add two more versions of its schema
  3. Make sure that all three versions are available in both Apicurio and Confluent-compatible APIs:

http://<schema_registry_url>/apis/registry/v2/groups/default/artifacts/<artifact_name>/versions
http://<schema_registry_url>/apis/ccompat/v7/subjects/<artifact_name>/versions

  1. Also make sure that a respective subject is availble in the Confluent-compatible API:

http://<schema_registry_url>/apis/ccompat/v7/subjects

  1. Disable the last version of the artifact:

curl --location --request PUT 'http://<schema_registry_url>/apis/registry/v2/groups/default/artifacts/<artifact_name>/versions/3/state' \
-H "Content-Type: application/json"
--data '{"state": "DISABLED"}'

  1. Make sure that subject disappeared from Confluent-compatible API, even though there are two enabled versions of it available:

http://<schema_registry_url>/apis/ccompat/v7/subjects

Expected vs Actual Behaviour

Expected behaviour here is that the subject should be available while there is still at least one enabled schema version available.

But for some reason artifact itself transits to disabled state after its last version is being disabled. At the same time it is possible to get all the information regarding its versions from the APIs (both Apicurio and Confluent-compatible).

Confluent-compatible API, for example, returns the latest (second) version of schema in this case with no problem from this endpoint (works fine in UI as well):

http://<schema_registry_url>:8080/apis/ccompat/v7/subjects/<artifact_name>/versions/latest

@EricWittmann
Copy link
Member

Thank you for the report. This does sound like a bug in 2.6.

It's worth noting that this should not be a problem in 3.0, because we have simplified the core API. Artifacts in 3.0 no longer have status. Only versions have status. So you can still disable a version, and you can disable all versions. That will have an impact on which version is returned when getting the latest. But since artifacts no longer have the concept of status, it shouldn't be a problem.

That said, we Will continue to support V2 of the core API in 3.0. so this will likely need to be fixed in any case. I just wanted to add some context.

@EricWittmann EricWittmann added this to the 3.x milestone Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants
@EricWittmann @dpilin and others