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

fix: add slash after generated region_dir #2463

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

waynexia
Copy link
Member

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

MySQL [(none)]> show tables;
+---------+
| Tables  |
+---------+
| numbers |
| scripts |
| t       |
+---------+
3 rows in set (0.013 sec)

MySQL [(none)]> drop table t;
Query OK, 1 row affected (0.004 sec)

MySQL [(none)]> show tables;
+---------+
| Tables  |
+---------+
| numbers |
| scripts |
+---------+
2 rows in set (0.001 sec)

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

closes #2457

@fengjiachun
Copy link
Collaborator

@waynexia The unit test failed

Copy link
Member

@WenyXu WenyXu left a comment

Choose a reason for hiding this comment

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

verbose: We need always keep in mind all directory paths should end with /

Signed-off-by: Ruihang Xia <[email protected]>
@evenyag
Copy link
Contributor

evenyag commented Sep 21, 2023

We still need to sanitize the dir in mito2, as I mentioned in #2457 (comment)

@waynexia
Copy link
Member Author

We still need to sanitize the dir in mito2, as I mentioned in #2457 (comment)

All region dir generated by this function will end with slash. There is no second method to concat it. Unless you direct give a random string as dir, which is neither possible nor viable to validate them all.

@killme2008
Copy link
Contributor

killme2008 commented Sep 21, 2023

I think we can normalize the path when creating or opening regions. Then it can cover all the cases using the normalized one instead of the raw path.

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #2463 (bb5123b) into develop (580d11b) will decrease coverage by 0.37%.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2463      +/-   ##
===========================================
- Coverage    84.83%   84.46%   -0.37%     
===========================================
  Files          726      726              
  Lines       114995   114995              
===========================================
- Hits         97551    97130     -421     
- Misses       17444    17865     +421     

@evenyag
Copy link
Contributor

evenyag commented Sep 21, 2023

This is related to the behavior of mito2. If region_dir must end with /, then mito2 should return an error, or sanitize the directory. I'll add this check later.

@waynexia waynexia added this pull request to the merge queue Sep 21, 2023
Merged via the queue into GreptimeTeam:develop with commit e3f53a8 Sep 21, 2023
@waynexia waynexia deleted the fix-gc-path branch September 21, 2023 07:56
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* fix: add slash after generated region_dir

Signed-off-by: Ruihang Xia <[email protected]>

* update ut

Signed-off-by: Ruihang Xia <[email protected]>

---------

Signed-off-by: Ruihang Xia <[email protected]>
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.

Incorrect GC directory path
5 participants