Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

refactor: replace reopen shard with open table #129

Merged
merged 2 commits into from
Jan 13, 2023

Conversation

ZuLiangWang
Copy link
Contributor

Which issue does this PR close?

Closes #

Rationale for this change

When creating partition table, CeresMeta need to open tables on multiple shards, but CeresDB only supports open/close shard interface, so we implement open table by reopen shard. This is an inefficient way, which will cause shard to be unavailable during table creation. It's should be replaced with open table after CeresDB provides new interface.

What changes are included in this PR?

  • Add OpenTableOnShard implementation in DispatchImpl.
  • Replace CloseShard and OpenShard with OpenTableOnShard.
  • Fix missing param UpdateShardVersion in DropPartitionTableProcedure.

Are there any user-facing changes?

Shard can work normally when creating/drop partition tables.

How does this change test

Pass existing unit tests.

@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2023

Codecov Report

Merging #129 (d5f1218) into main (423ca15) will decrease coverage by 0.72%.
The diff coverage is 37.58%.

@@            Coverage Diff             @@
##             main     #129      +/-   ##
==========================================
- Coverage   39.80%   39.07%   -0.73%     
==========================================
  Files          29       33       +4     
  Lines        3432     4217     +785     
==========================================
+ Hits         1366     1648     +282     
- Misses       1882     2317     +435     
- Partials      184      252      +68     
Impacted Files Coverage Δ
server/cluster/cluster.go 0.00% <0.00%> (ø)
server/cluster/manager.go 0.00% <0.00%> (ø)
server/cluster/table_manager.go 0.00% <0.00%> (ø)
server/cluster/topology_manager.go 0.00% <0.00%> (ø)
server/cluster/types.go 0.00% <0.00%> (ø)
server/coordinator/procedure/factory.go 0.00% <0.00%> (ø)
server/coordinator/procedure/manager_impl.go 0.00% <0.00%> (ø)
server/coordinator/procedure/scatter.go 65.00% <20.00%> (-1.92%) ⬇️
server/coordinator/procedure/util.go 38.88% <40.00%> (+0.17%) ⬆️
...er/coordinator/procedure/create_partition_table.go 40.50% <40.50%> (ø)
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ZuLiangWang ZuLiangWang force-pushed the reopen_shard branch 2 times, most recently from f4f091c to c979a9c Compare January 11, 2023 09:07
Copy link
Member

@ShiKaiWi ShiKaiWi left a comment

Choose a reason for hiding this comment

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

Names of some variable are weird, I guess we need names with clearer meaning.

Copy link
Member

@ShiKaiWi ShiKaiWi left a comment

Choose a reason for hiding this comment

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

LGTM

@ShiKaiWi ShiKaiWi merged commit 494e15e into apache:main Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants