Skip to content

Conversation

@zhangheihei
Copy link
Contributor

@zhangheihei zhangheihei commented Nov 20, 2025

Why I'm doing:

  1. select takes 0.06s
919 rows in set (0.06 sec)

mysql> 
mysql> 
mysql> select * from ads_member_integral_dashboard_1day_new;
  1. set starlet_filesystem_instance_cache_capacity to 0
mysql> update information_schema.be_configs set value = 0 where name = "starlet_filesystem_instance_cache_capacity";
Query OK, 0 rows affected (0.17 sec)
  1. select takes 24.33s
919 rows in set (24.33 sec)

mysql> select * from ads_member_integral_dashboard_1day_new;
  1. set starlet_filesystem_instance_cache_capacity to 10000
mysql> update information_schema.be_configs set value = 10000 where name = "starlet_filesystem_instance_cache_capacity";
Query OK, 0 rows affected (0.02 sec)

  1. select still takes
919 rows in set (21.30 sec)

mysql> select * from ads_member_integral_dashboard_1day_new;
  1. create new table from ads_member_integral_dashboard_1day_new
create table a01 as select * from ads_member_integral_dashboard_1day_new;
Query OK, 919 rows affected (23.72 sec)
{'label':'insert_66677f66-c61f-11f0-86f9-525400979433', 'status':'VISIBLE', 'txnId':'34767'}
  1. select a01 takes
919 rows in set (0.06 sec)

mysql> select * from a01;

What I'm doing:

#60053 has been fixed the bug resolving the cache failure issue. However, the problem still persists where the same string cache_key holds two std::shared_ptr<std::string> objects.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.0
    • 3.5
    • 3.4
    • 3.3

@zhangheihei zhangheihei force-pushed the bugfix-filesystem-cache branch from 0d8331a to 1b194b1 Compare November 20, 2025 14:50
Signed-off-by: edwinhzhang <[email protected]>
@zhangheihei zhangheihei force-pushed the bugfix-filesystem-cache branch from 43485ee to 46c7e34 Compare November 21, 2025 03:06
@kevincai kevincai requested a review from Copilot November 21, 2025 12:19
Copilot finished reviewing on behalf of kevincai November 21, 2025 12:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a filesystem cache bug where the same cache key could have multiple std::shared_ptr<std::string> objects with custom deleters. When one shared_ptr was destroyed, it would erase the cache entry prematurely, causing performance degradation for other users of that cache entry.

Key Changes:

  • Added shard_id parameter to filesystem creation functions to enable shard-specific cache key reuse
  • Modified insert_fs_cache to check if the shard already has a fs_cache_key for the given cache key and reuse it if found
  • Ensures only one std::shared_ptr<std::string> exists per shard-cache_key combination

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
be/src/service/staros_worker.h Added shard_id parameter to new_shared_filesystem and insert_fs_cache method signatures
be/src/service/staros_worker.cpp Implemented cache key reuse logic in insert_fs_cache by checking shard's existing fs_cache_key before creating a new one, and updated call sites to pass shard_id

@kevincai kevincai changed the title [BugFix]Fix filesystem cache failture. [BugFix]Fix filesystem cache failure. Nov 23, 2025
@zhangheihei zhangheihei force-pushed the bugfix-filesystem-cache branch from 361c294 to 1c512c5 Compare November 24, 2025 04:01
Signed-off-by: edwinhzhang <[email protected]>
@zhangheihei zhangheihei force-pushed the bugfix-filesystem-cache branch from 5e5fc10 to 5fff4d2 Compare November 24, 2025 05:22
Signed-off-by: edwinhzhang <[email protected]>
@zhangheihei zhangheihei force-pushed the bugfix-filesystem-cache branch from 1a127ba to fabd3b5 Compare November 24, 2025 05:29
Signed-off-by: edwinhzhang <[email protected]>
@zhangheihei zhangheihei force-pushed the bugfix-filesystem-cache branch from f1f1b01 to a1d41fc Compare November 24, 2025 06:32
xiangguangyxg
xiangguangyxg previously approved these changes Nov 24, 2025
@xiangguangyxg xiangguangyxg enabled auto-merge (squash) November 24, 2025 10:48
@kevincai kevincai marked this pull request as draft November 25, 2025 08:17
auto-merge was automatically disabled November 25, 2025 08:17

Pull request was converted to draft

@github-actions github-actions bot removed the 3.4 label Nov 26, 2025
@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

backport branch-3.5

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

backport branch-4.0

🛑 Command backport branch-4.0 cancelled because of a new backport command with different arguments

@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

backport branch-3.3

🛑 Command backport branch-3.3 cancelled because of a new backport command with different arguments

@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

backport branch-3.4

🛑 Command backport branch-3.4 cancelled because of a new backport command with different arguments

mergify bot pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
(cherry picked from commit 06a0a19)
@kevincai
Copy link
Contributor

@Mergifyio backport branch-4.0 branch-3.5 branch-3.4 branch-3.3

@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

backport branch-4.0 branch-3.5 branch-3.4 branch-3.3

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
(cherry picked from commit 06a0a19)
wanpengfei-git pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
Co-authored-by: zhanghe <[email protected]>
@kevincai
Copy link
Contributor

@Mergifyio backport branch-4.0

@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

backport branch-4.0

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
(cherry picked from commit 06a0a19)
@kevincai
Copy link
Contributor

@Mergifyio backport branch-3.4

@kevincai
Copy link
Contributor

@Mergifyio backport branch-3.3

@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

backport branch-3.4

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

backport branch-3.3

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
(cherry picked from commit 06a0a19)
mergify bot pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
(cherry picked from commit 06a0a19)
wanpengfei-git pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
Co-authored-by: zhanghe <[email protected]>
wanpengfei-git pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
Co-authored-by: zhanghe <[email protected]>
wanpengfei-git pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: edwinhzhang <[email protected]>
Signed-off-by: edwinhzhang <[email protected]>
Co-authored-by: zhanghe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants