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

ISSUE-2361: remote backend for fuse table #2355

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Oct 20, 2021

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

Summary

  • simple impl of the remote backend for fuse table
  • recovery integration tests '^09_*'

for reviewers:

  • two additional match branches have been added to DataValue::try_into_data_array
    test cases seem work, but I am not sure if they are proper
  • metadata is updated without consensus, will be fixed in latter PR

Changelog

  • Improvement
  • Not for changelog (changelog entry is not required)

Related Issues

Fixes: #2361

Test Plan

Unit Tests

Stateless Tests

@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2021

Codecov Report

Merging #2355 (b8b128e) into main (8107725) will decrease coverage by 0%.
The diff coverage is 30%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2355   +/-   ##
=====================================
- Coverage     71%     71%   -1%     
=====================================
  Files        633     633           
  Lines      35703   35754   +51     
=====================================
- Hits       25436   25428    -8     
- Misses     10267   10326   +59     
Impacted Files Coverage Δ
common/datavalues/src/data_value_ops.rs 40% <0%> (-3%) ⬇️
common/meta/raft-store/src/state_machine/sm.rs 95% <ø> (ø)
metasrv/src/executor/action_handler.rs 92% <0%> (-4%) ⬇️
metasrv/src/meta_service/raftmeta.rs 87% <0%> (-3%) ⬇️
query/src/catalogs/backends/impls/meta_cached.rs 0% <0%> (ø)
query/src/catalogs/backends/impls/meta_remote.rs 0% <0%> (ø)
query/src/catalogs/backends/impls/meta_sync.rs 0% <0%> (ø)
...uery/src/catalogs/backends/impls/remote_backend.rs 0% <0%> (ø)
query/src/catalogs/catalog.rs 0% <ø> (ø)
query/src/catalogs/impls/catalog/system_catalog.rs 77% <0%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8107725...b8b128e. Read the comment docs.

@BohuTANG
Copy link
Member

This PR needs an issue to track, for example in our release proposal :)

@dantengsky
Copy link
Member Author

This PR needs an issue to track, for example in our release proposal :)

got it

@dantengsky dantengsky changed the title remote backend for fuse table ISSUE-2361: remote backend for fuse table Oct 21, 2021
@dantengsky dantengsky force-pushed the feature-remote-backend branch from eedcd41 to 351fc51 Compare October 21, 2021 03:20
@dantengsky dantengsky marked this pull request as ready for review October 21, 2021 03:40
@@ -85,6 +85,12 @@ impl DataValue {
}
DataType::Boolean => try_build_array! {values},
DataType::String => try_build_array! {String, values},
DataType::Date16 => {
Copy link
Member

Choose a reason for hiding this comment

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

Miss Date32

Copy link
Member Author

Choose a reason for hiding this comment

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

got it

@@ -186,7 +186,10 @@ macro_rules! try_build_array {
match value {
DataValue::$SCALAR_TY(Some(v)) => builder.append_value(*v),
DataValue::$SCALAR_TY(None) => builder.append_null(),
_ => unreachable!(),
dv => {
Copy link
Member

Choose a reason for hiding this comment

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

unreachable!(dv) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, forget code GC here

@dantengsky
Copy link
Member Author

/cc @sundy-li PTAL

Comment on lines +59 to +65
async fn upsert_table_option(
&self,
table_id: MetaId,
new_table_version: MetaVersion,
new_snapshot_location: String,
) -> Result<CommitTableReply>;
table_version: MetaVersion,
option_key: String,
option_value: String,
) -> Result<UpsertTableOptionReply>;
Copy link
Member

Choose a reason for hiding this comment

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

Why not just define a upsert_table, to update an entire table instance?

An update of a single field is only useful with non-serialized concurrency control. E.g. two concurrent commutative update operations to a single table.

As MetaVersion must be matched, it is serialized. Updating the entire table simplifies the backend impl.

Copy link
Member Author

Choose a reason for hiding this comment

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

right, that is more reasonable. let's fix this in latter prs

Copy link
Member

Choose a reason for hiding this comment

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

Then everything else looks good enough to me.

@BohuTANG
Copy link
Member

/lgtm

Great, welcome fuse table come back.

@databend-bot
Copy link
Member

Approved! Thank you for the PR @dantengsky

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot databend-bot merged commit 2b9cd07 into databendlabs:main Oct 21, 2021
@drmingdrmer
Copy link
Member

BTW, there should be a unit test to the new API upsert_table_option().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable "remote meta service" for fuse table
6 participants