-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
(cloud-merge) Supports online capacity expansion and contraction #37484
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -30,6 +30,7 @@ FileCacheSettings get_file_cache_settings(size_t capacity, size_t max_query_cach | |||
size_t normal_percent, size_t disposable_percent, | |||
size_t index_percent) { | |||
io::FileCacheSettings settings; | |||
if (capacity == 0) return settings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: statement should be inside braces [readability-braces-around-statements]
if (capacity == 0) return settings; | |
if (capacity == 0) { return settings; | |
} |
auto key = io::BlockFileCache::hash("key1"); | ||
auto key2 = io::BlockFileCache::hash("key2"); | ||
io::BlockFileCache cache(cache_base_path, settings); | ||
auto sp = SyncPoint::get_instance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto sp' can be declared as 'auto *sp' [readability-qualified-auto]
auto sp = SyncPoint::get_instance(); | |
s);auto * |
; | ||
EXPECT_EQ(cache._cur_cache_size, 30); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: statement should be inside braces [readability-braces-around-statements]
; | |
EXPECT_EQ(cache._cur_cache_size, 30); | |
he) { | |
; | |
} |
TPC-H: Total hot run time: 41188 ms
|
TPC-DS: Total hot run time: 173877 ms
|
ClickBench: Total hot run time: 31.54 s
|
run buildall |
TPC-H: Total hot run time: 39940 ms
|
TPC-DS: Total hot run time: 174181 ms
|
ClickBench: Total hot run time: 30.59 s
|
run buildall |
TPC-H: Total hot run time: 40330 ms
|
TPC-DS: Total hot run time: 175753 ms
|
ClickBench: Total hot run time: 31.01 s
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
run cloud_p0 |
run buildall |
TPC-H: Total hot run time: 39450 ms
|
TPC-DS: Total hot run time: 172636 ms
|
ClickBench: Total hot run time: 31.08 s
|
) 1. Support to reset capacity online via BE HTTP requet 2. Support to analyze cache conf when only get path_name `file_cache_path=[{"path":"xxxx"}]`, we can only specify the path for a file cache instance from now on, if we don't care about the detailed capacity limit ``` # clear file cache curl ip:http_port/api/file_cache?op=clear # reset capacity of a certain instance of file cache curl ip:http_port/api/file_cache?op=reset&capacity=${capacity}&path=${cache_path} curl 127.0.0.1:8060/api/file_cache?op=clear curl 127.0.0.1:8060/api/file_cache?op=reset&capacity=102400000&path=/user/file_cache ```
…40831) ## Proposed changes Add a http action which can calculate its hash value based on the path you input. It's useful when you debug. ### API ```http GET /api/file_cache ``` ### request parameter |param|type |desc |require| |:--- |:--- |:--- |:--- | |op |string|the value must be `hash`, other value you can refer to #37484 |yes | |value|string|the input you want to calc hash |yes | ### response if success |param|type |desc | |:--- |:--- |:--- | |hash |string|the hash value of your input| if fail |param |type |desc | |:--- |:--- |:--- | |status|string|error status | |msg |string|error message| ### example #### case 1 ```bash curl '172.100.0.4:8040/api/file_cache?op=hash&value=0200000000000001bf42c14374fff491ffb7c89a1a65c5bb_0.dat' ``` return ```json {"hash":"c6a599f453f67f0949f80ad9990fa3dd"} ``` #### case 2 ```bash curl '172.100.0.4:8040/api/file_cache?op=hash' ``` return ```json { "status": "INVALID_ARGUMENT", "msg": "missing parameter: value is required" } ```
…40831) ## Proposed changes Add a http action which can calculate its hash value based on the path you input. It's useful when you debug. ### API ```http GET /api/file_cache ``` ### request parameter |param|type |desc |require| |:--- |:--- |:--- |:--- | |op |string|the value must be `hash`, other value you can refer to #37484 |yes | |value|string|the input you want to calc hash |yes | ### response if success |param|type |desc | |:--- |:--- |:--- | |hash |string|the hash value of your input| if fail |param |type |desc | |:--- |:--- |:--- | |status|string|error status | |msg |string|error message| ### example #### case 1 ```bash curl '172.100.0.4:8040/api/file_cache?op=hash&value=0200000000000001bf42c14374fff491ffb7c89a1a65c5bb_0.dat' ``` return ```json {"hash":"c6a599f453f67f0949f80ad9990fa3dd"} ``` #### case 2 ```bash curl '172.100.0.4:8040/api/file_cache?op=hash' ``` return ```json { "status": "INVALID_ARGUMENT", "msg": "missing parameter: value is required" } ```
…1037) ## Proposed changes Add a http action which is useful when you debug. ### API ```http GET /api/file_cache ``` ### request parameter #### request parameter1 |param|type|desc|require| |:---|:---|:---|:---| |op|string|the value must be `list_cache`, other value you can refer to #40831 #37484 |yes| |value|string|the segment file name |yes| #### request parameter2 |param|type|desc|require| |:---|:---|:---|:---| |op|string|the value must be `clear`, other value you can refer to #40831 #37484 |yes| |value|string|the segment file name |yes| |sync|bool|clean local cache in sync |no| ### response #### response1 if success |param|type|desc| |:---|:---|:---| ||array|return the segment file cache in local path| if fail |param|type|desc| |:---|:---|:---| ||array|empty array| #### response2 if success |param|type|desc| |:---|:---|:---| |status|string|| |msg|string|| ### example #### case 1 ```bash curl '172.100.0.4:8040/api/file_cache?op=list_cache&value=0200000000000001bf42c14374fff491ffb7c89a1a65c5bb_0.dat' ``` return ```json ["/opt/doris/be/file_cache/c6a/c6a599f453f67f0949f80ad9990fa3dd/0"] ``` #### case 2 ```bash curl '127.0.0.1:8040/api/file_cache?op=clear&sync=true&value=0200000000000001284b68fea3dcfe8a83e65cd88426b081_0.dat' ``` return ```json { "status": "OK", "msg": "OK" } ```
…ache#41037) ## Proposed changes Add a http action which is useful when you debug. ### API ```http GET /api/file_cache ``` ### request parameter #### request parameter1 |param|type|desc|require| |:---|:---|:---|:---| |op|string|the value must be `list_cache`, other value you can refer to apache#40831 apache#37484 |yes| |value|string|the segment file name |yes| #### request parameter2 |param|type|desc|require| |:---|:---|:---|:---| |op|string|the value must be `clear`, other value you can refer to apache#40831 apache#37484 |yes| |value|string|the segment file name |yes| |sync|bool|clean local cache in sync |no| ### response #### response1 if success |param|type|desc| |:---|:---|:---| ||array|return the segment file cache in local path| if fail |param|type|desc| |:---|:---|:---| ||array|empty array| #### response2 if success |param|type|desc| |:---|:---|:---| |status|string|| |msg|string|| ### example #### case 1 ```bash curl '172.100.0.4:8040/api/file_cache?op=list_cache&value=0200000000000001bf42c14374fff491ffb7c89a1a65c5bb_0.dat' ``` return ```json ["/opt/doris/be/file_cache/c6a/c6a599f453f67f0949f80ad9990fa3dd/0"] ``` #### case 2 ```bash curl '127.0.0.1:8040/api/file_cache?op=clear&sync=true&value=0200000000000001284b68fea3dcfe8a83e65cd88426b081_0.dat' ``` return ```json { "status": "OK", "msg": "OK" } ``` (cherry picked from commit 99d0748)
…and clear (#41037) (#43412) ## Proposed changes Add a http action which is useful when you debug. ### API ```http GET /api/file_cache ``` ### request parameter #### request parameter1 |param|type|desc|require| |:---|:---|:---|:---| |op|string|the value must be `list_cache`, other value you can refer to #40831 #37484 |yes| |value|string|the segment file name |yes| #### request parameter2 |param|type|desc|require| |:---|:---|:---|:---| |op|string|the value must be `clear`, other value you can refer to #40831 #37484 |yes| |value|string|the segment file name |yes| |sync|bool|clean local cache in sync |no| ### response #### response1 if success |param|type|desc| |:---|:---|:---| ||array|return the segment file cache in local path| if fail |param|type|desc| |:---|:---|:---| ||array|empty array| #### response2 if success |param|type|desc| |:---|:---|:---| |status|string|| |msg|string|| ### example #### case 1 ```bash curl '172.100.0.4:8040/api/file_cache?op=list_cache&value=0200000000000001bf42c14374fff491ffb7c89a1a65c5bb_0.dat' ``` return ```json ["/opt/doris/be/file_cache/c6a/c6a599f453f67f0949f80ad9990fa3dd/0"] ``` #### case 2 ```bash curl '127.0.0.1:8040/api/file_cache?op=clear&sync=true&value=0200000000000001284b68fea3dcfe8a83e65cd88426b081_0.dat' ``` return ```json { "status": "OK", "msg": "OK" } ``` (cherry picked from commit 99d0748)
file_cache_path=[{"path":"xxxx"}]
, we can only specify the path for a file cache instance from now on, if we don't care about the detailed capacity limit