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

chore: adjust fuse_time_travel_size() #17164

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

SkyFan2002
Copy link
Member

@SkyFan2002 SkyFan2002 commented Jan 3, 2025

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

Summary

  1. In the past, fuse_time_travel_size() did not account for tables with a drop time exceeding 24 hours. After this PR, these tables will be included in the count.
  2. This PR will not affect the behavior of other parts of the system.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Jan 3, 2025
@SkyFan2002 SkyFan2002 changed the title chore: adjust system.tables_with_history chore: adjust fuse_time_travel_size() Jan 3, 2025
@SkyFan2002 SkyFan2002 force-pushed the fix_tables_with_history branch from c7bedf2 to 56aa349 Compare January 3, 2025 08:15
@SkyFan2002 SkyFan2002 marked this pull request as draft January 3, 2025 08:15
@SkyFan2002 SkyFan2002 marked this pull request as ready for review January 3, 2025 08:51
Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

A test should be added to ensure non-retainable tables are returned as expected

Reviewed 4 of 7 files at r1, all commit messages.
Reviewable status: 4 of 7 files reviewed, 4 unresolved discussions (waiting on @dantengsky, @SkyFan2002, and @TCeason)


src/meta/api/src/schema_api.rs line 230 at r1 (raw file):

        include_non_retainable: bool,
        req: ListTableReq,
    ) -> Result<Vec<TableNIV>, KVAppError>;

The method name should be updated too, if it returns both retainable and non-retainable tables.

Code quote:

    async fn list_retainable_tables(
        &self,
        include_non_retainable: bool,
        req: ListTableReq,
    ) -> Result<Vec<TableNIV>, KVAppError>;

src/meta/api/src/schema_api_impl.rs line 3068 at r1 (raw file):

async fn get_retainable_table_metas(
    kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
    include_non_retainable: bool,

Update method name

Code quote:

async fn get_retainable_table_metas(
    kv_api: &(impl kvapi::KVApi<Error = MetaError> + ?Sized),
    include_non_retainable: bool,

src/query/service/src/databases/default/default_database.rs line 199 at r1 (raw file):

        &self,
        include_non_retainable: bool,
    ) -> Result<Vec<Arc<dyn Table>>> {

update method name

Code quote:

    async fn list_tables_history(
        &self,
        include_non_retainable: bool,
    ) -> Result<Vec<Arc<dyn Table>>> {

src/query/service/src/databases/default/default_database.rs line 211 at r1 (raw file):

                include_non_retainable,
                ListTableReq::new(self.get_tenant(), self.db_info.database_id),
            )

update method name

Code quote:

            .list_retainable_tables(
                include_non_retainable,
                ListTableReq::new(self.get_tenant(), self.db_info.database_id),
            )

@SkyFan2002 SkyFan2002 requested a review from drmingdrmer January 5, 2025 08:22
Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 7 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dantengsky and @TCeason)

@drmingdrmer drmingdrmer force-pushed the fix_tables_with_history branch from 751f4bb to 33c6c56 Compare January 5, 2025 10:58
Copy link
Collaborator

@TCeason TCeason left a comment

Choose a reason for hiding this comment

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

LGTM this logic not impact db and tables with history.

@dantengsky dantengsky added this pull request to the merge queue Jan 6, 2025
@BohuTANG BohuTANG removed this pull request from the merge queue due to a manual request Jan 6, 2025
@BohuTANG BohuTANG merged commit d6ed558 into databendlabs:main Jan 6, 2025
72 of 73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-chore this PR only has small changes that no need to record, like coding styles.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants