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

refactor(meta/client): add compatible layer for upgrade #10082

Merged
merged 2 commits into from
Feb 16, 2023

Conversation

drmingdrmer
Copy link
Member

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

refactor(meta/client): add compatible layer for upgrade

Currently meta-service responds KVAppError for kv-api, which is too big.
MetaAPIError, which is a sub error of KVAppError, would be enough.

This is the first step of this change: let the client be able to parse
both KVAppError and MetaAPIError. When this patch is merged, the
server side can upgrade to produce just MetaAPIError.

Changes on client side:

Add type Compatible<Outer, Inner> as a compatbile enum for both
KVAppError and MetaAPIError.

Try to parse a responded error into Compatible then extract
MetaAPIError for use.

It no longer uses KVAppError, e.g., SchemaApi or ShareApi just relies
on a KVApi implementation that just returns MetaError.

Changes on server side:

The meta sercie still responds KVAppError. But some of the error types
used internally are adjusted.

chore(meta/kvapi): MetaGrpcClient does not need to impl KVApi

Changelog

Related Issues

@vercel
Copy link

vercel bot commented Feb 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
databend ⬜️ Ignored (Inspect) Feb 16, 2023 at 8:04AM (UTC)

@mergify mergify bot added the pr-refactor this PR changes the code base without new features or bugfix label Feb 16, 2023
Currently meta-service responds `KVAppError` for kv-api, which is too big.
`MetaAPIError`, which is a sub error of `KVAppError`,  would be enough.

This is the first step of this change: let the client be able to parse
both `KVAppError` and `MetaAPIError`. When this patch is merged, the
server side can upgrade to produce just `MetaAPIError`.

Changes on client side:

Add type `Compatible<Outer, Inner>` as a compatbile enum for both
`KVAppError` and `MetaAPIError`.

Try to parse a responded error into `Compatible` then extract
`MetaAPIError` for use.

It no longer uses `KVAppError`, e.g., SchemaApi or ShareApi just relies
on a KVApi implementation that just returns MetaError.

Changes on server side:

The meta sercie still responds `KVAppError`. But some of the error types
used internally are adjusted.
@BohuTANG BohuTANG merged commit 100b658 into datafuselabs:main Feb 16, 2023
@drmingdrmer drmingdrmer deleted the 45-compat-err branch February 16, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants