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

Passive flush with gap between current applied index and last flushed index #7899

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
dbfec4a
background delta flush
hehechen Mar 1, 2023
2f873bf
fix lock
hehechen Mar 1, 2023
ffd10d1
add lock held
CalvinNeo May 29, 2023
c6391ab
Merge remote-tracking branch 'upstream/master' into calvin_delta_flus…
CalvinNeo May 29, 2023
08a7c45
add tests
CalvinNeo May 29, 2023
6c5986f
add findByRangeChecked
CalvinNeo May 30, 2023
a7723f4
f
CalvinNeo May 30, 2023
03a3da3
fix
CalvinNeo May 30, 2023
9c0e733
lock
CalvinNeo May 31, 2023
2105a5a
fix lock
CalvinNeo Jun 15, 2023
253061a
try recursive
CalvinNeo Jun 16, 2023
df454d5
dont lock kvstore
CalvinNeo Jun 16, 2023
5686b5c
tto be revert: remove all locks
CalvinNeo Jun 16, 2023
94c9265
Revert "tto be revert: remove all locks"
CalvinNeo Jun 19, 2023
7db53fe
to revert really remove lock
CalvinNeo Jun 19, 2023
ba3596c
revert
CalvinNeo Jun 20, 2023
2dfaab1
fix 2 fg lock
CalvinNeo Jun 20, 2023
6d6cc37
add some tests
CalvinNeo Jun 25, 2023
9cb9ec1
support test of notify
CalvinNeo Jun 27, 2023
6aa3dc6
settings,tests,proxy updates
CalvinNeo Jun 28, 2023
6b7b256
fmt
CalvinNeo Jul 3, 2023
c4b3173
a
CalvinNeo Jul 6, 2023
e75bd6d
Merge remote-tracking branch 'upstream/master' into calvin_delta_flus…
CalvinNeo Jul 6, 2023
c080671
remove get flush state when exec_compact_log
CalvinNeo Jul 12, 2023
3b93e12
metrics: part1
CalvinNeo Jul 20, 2023
2ea06c2
z
CalvinNeo Jul 20, 2023
a0ecfe5
update jul26
CalvinNeo Jul 25, 2023
eb698cc
fix proxy
CalvinNeo Jul 25, 2023
ac8e88f
get flushed state
CalvinNeo Jul 25, 2023
d4f0961
mew log
CalvinNeo Aug 1, 2023
4de6a63
aaaa
CalvinNeo Aug 3, 2023
e9e7fce
f
CalvinNeo Aug 4, 2023
2d08004
a
CalvinNeo Aug 4, 2023
979f1cd
remove some proactive code
CalvinNeo Aug 4, 2023
c1c3ebc
remove fps
CalvinNeo Aug 4, 2023
0f111d4
Merge remote-tracking branch 'upstream/master' into calvin_delta_flus…
CalvinNeo Aug 4, 2023
084077f
f
CalvinNeo Aug 4, 2023
6317985
f
CalvinNeo Aug 4, 2023
74d78ff
a
CalvinNeo Aug 4, 2023
afe4c92
fff
CalvinNeo Aug 4, 2023
32fac3f
add more logs
CalvinNeo Aug 4, 2023
3cb8c76
add more logs
CalvinNeo Aug 4, 2023
3d63b20
a
CalvinNeo Aug 7, 2023
fd0a5f1
a
CalvinNeo Aug 7, 2023
7636776
Update dbms/src/Storages/DeltaMerge/DeltaMergeInterfaces.h
CalvinNeo Aug 7, 2023
c8d4f37
f
CalvinNeo Aug 8, 2023
83fc9e7
Merge branch 'calvin_delta_flush_bg_without_tikv' of github.com:Calvi…
CalvinNeo Aug 8, 2023
01abeb0
applied
CalvinNeo Aug 8, 2023
97261a9
applied 2
CalvinNeo Aug 8, 2023
2a36c95
applied 3
CalvinNeo Aug 8, 2023
05b5f43
applied 4
CalvinNeo Aug 8, 2023
81b4b5a
apply 5
CalvinNeo Aug 8, 2023
427e8c3
metrics
CalvinNeo Aug 8, 2023
623db32
f
CalvinNeo Aug 8, 2023
4a514ee
ffff
CalvinNeo Aug 9, 2023
6bb12a4
remove all commented
CalvinNeo Aug 9, 2023
c9648c9
Merge remote-tracking branch 'upstream/master' into calvin_delta_flus…
CalvinNeo Aug 9, 2023
1ebb2fe
proxy
CalvinNeo Aug 9, 2023
6bd6492
Update dbms/src/Storages/Transaction/RegionPersister.cpp
CalvinNeo Aug 10, 2023
14b74fb
Update dbms/src/Storages/Transaction/tests/gtest_kvstore.cpp
CalvinNeo Aug 10, 2023
313fade
f
CalvinNeo Aug 11, 2023
d9ac794
Merge branch 'calvin_delta_flush_bg_without_tikv' of github.com:Calvi…
CalvinNeo Aug 11, 2023
f624033
addr cmt
CalvinNeo Aug 11, 2023
a340c74
fix some tests
CalvinNeo Aug 11, 2023
363fd5d
add debug
CalvinNeo Aug 11, 2023
8321f69
Update dbms/src/Storages/DeltaMerge/DeltaMergeStore.h
CalvinNeo Aug 14, 2023
f7c25fc
addr cmt
CalvinNeo Aug 14, 2023
9b9bc1b
Merge branch 'calvin_delta_flush_bg_without_tikv' of github.com:Calvi…
CalvinNeo Aug 14, 2023
65bd0a3
remove deubg msgs
CalvinNeo Aug 14, 2023
704959f
fix error
CalvinNeo Aug 14, 2023
1006b4e
Merge remote-tracking branch 'upstream/master' into calvin_delta_flus…
CalvinNeo Aug 15, 2023
d1743a6
fmt
CalvinNeo Aug 15, 2023
3f66ec8
Merge branch 'master' into calvin_delta_flush_bg_without_tikv
CalvinNeo Aug 15, 2023
cc541f8
Merge branch 'master' into calvin_delta_flush_bg_without_tikv
CalvinNeo Aug 16, 2023
64b14b5
update proxy
CalvinNeo Aug 16, 2023
1e59422
f
CalvinNeo Aug 16, 2023
f0f729a
Merge remote-tracking branch 'upstream/master' into calvin_delta_flus…
CalvinNeo Aug 16, 2023
d16a7ab
Merge branch 'master' into calvin_delta_flush_bg_without_tikv
CalvinNeo Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions dbms/src/Common/FailPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ namespace DB
M(exception_before_dmfile_remove_encryption) \
M(exception_before_dmfile_remove_from_disk) \
M(force_triggle_background_merge_delta) \
M(force_triggle_foreground_flush) \
M(exception_before_mpp_make_non_root_mpp_task_active) \
M(exception_before_mpp_register_non_root_mpp_task) \
M(exception_before_mpp_register_tunnel_for_non_root_mpp_task) \
Expand Down Expand Up @@ -100,6 +99,7 @@ namespace DB
M(force_stop_background_checkpoint_upload) \
M(skip_seek_before_read_dmfile) \
M(exception_after_large_write_exceed) \
M(proactive_flush_force_set_type) \
M(exception_when_fetch_disagg_pages)

#define APPLY_FOR_PAUSEABLE_FAILPOINTS_ONCE(M) \
Expand All @@ -120,7 +120,8 @@ namespace DB
M(pause_when_ingesting_to_dt_store) \
M(pause_when_altering_dt_store) \
M(pause_after_copr_streams_acquired) \
M(pause_query_init)
M(pause_query_init) \
M(pause_passive_flush_before_persist_region)

#define APPLY_FOR_RANDOM_FAILPOINTS(M) \
M(random_tunnel_wait_timeout_failpoint) \
Expand Down Expand Up @@ -268,8 +269,7 @@ void FailPointHelper::enableFailPoint(const String & fail_point_name, std::optio
throw Exception(fmt::format("Cannot find fail point {}", fail_point_name), ErrorCodes::FAIL_POINT_ERROR);
}

std::optional<std::any>
FailPointHelper::getFailPointVal(const String & fail_point_name)
std::optional<std::any> FailPointHelper::getFailPointVal(const String & fail_point_name)
{
if (auto iter = fail_point_val.find(fail_point_name); iter != fail_point_val.end())
{
Expand Down Expand Up @@ -312,7 +312,10 @@ void FailPointHelper::initRandomFailPoints(Poco::Util::LayeredConfiguration & co
for (const auto & string_token : string_tokens)
{
Poco::StringTokenizer pair_tokens(string_token, "-");
RUNTIME_ASSERT((pair_tokens.count() == 2), log, "RandomFailPoints config should be FailPointA-RatioA,FailPointB-RatioB,... format");
RUNTIME_ASSERT(
(pair_tokens.count() == 2),
log,
"RandomFailPoints config should be FailPointA-RatioA,FailPointB-RatioB,... format");
double rate = atof(pair_tokens[1].c_str()); //NOLINT(cert-err34-c): check conversion error manually
RUNTIME_ASSERT((0 <= rate && rate <= 1.0), log, "RandomFailPoint trigger rate should in [0,1], while {}", rate);
enableRandomFailPoint(pair_tokens[0], rate);
Expand All @@ -330,7 +333,10 @@ void FailPointHelper::disableRandomFailPoints(Poco::Util::LayeredConfiguration &
for (const auto & string_token : string_tokens)
{
Poco::StringTokenizer pair_tokens(string_token, "-");
RUNTIME_ASSERT((pair_tokens.count() == 2), log, "RandomFailPoints config should be FailPointA-RatioA,FailPointB-RatioB,... format");
RUNTIME_ASSERT(
(pair_tokens.count() == 2),
log,
"RandomFailPoints config should be FailPointA-RatioA,FailPointB-RatioB,... format");
disableFailPoint(pair_tokens[0]);
}
LOG_INFO(log, "Disable RandomFailPoints: {}", random_fail_point_cfg);
Expand Down
27 changes: 26 additions & 1 deletion dbms/src/Common/TiFlashMetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,31 @@ namespace DB
Histogram, \
F(type_decode, {{"type", "decode"}}, ExpBuckets{0.0005, 2, 20}), \
F(type_write, {{"type", "write"}}, ExpBuckets{0.0005, 2, 20})) \
M(tiflash_raft_raft_log_lag_count, \
"Bucketed histogram raft index lag", \
Histogram, \
F(type_compact_index, {{"type", "compact_index"}}, EqualWidthBuckets{0, 200, 5}), \
F(type_applied_index, {{"type", "applied_index"}}, EqualWidthBuckets{0, 200, 5}), \
F(type_unflushed_applied_index, {{"type", "unflushed_applied_index"}}, EqualWidthBuckets{0, 200, 5})) \
M(tiflash_raft_raft_events_count, \
"Raft event counter", \
Counter, \
F(type_pre_exec_compact, {{"type", "pre_exec_compact"}}), \
F(type_flush_apply_snapshot, {{"type", "flush_apply_snapshot"}}), \
F(type_flush_ingest_sst, {{"type", "flush_ingest_sst"}}), \
F(type_flush_useless_admin, {{"type", "flush_useless_admin"}}), \
F(type_flush_useful_admin, {{"type", "flush_useful_admin"}}), \
F(type_flush_passive, {{"type", "flush_passive"}}), \
F(type_flush_proactive, {{"type", "flush_proactive"}}), \
F(type_flush_log_gap, {{"type", "flush_log_gap"}}), \
F(type_flush_size, {{"type", "flush_size"}}), \
F(type_flush_rowcount, {{"type", "flush_rowcount"}}), \
F(type_exec_compact, {{"type", "exec_compact"}})) \
M(tiflash_raft_region_flush_size, \
"Bucketed histogram of region flushed size", \
Histogram, \
F(type_flushed, {{"type", "flushed"}}, ExpBuckets{32, 2, 16}), \
F(type_unflushed, {{"type", "unflushed"}}, ExpBuckets{32, 2, 16})) \
/* required by DBaaS */ \
M(tiflash_server_info, \
"Indicate the tiflash server info, and the value is the start timestamp (s).", \
Expand Down Expand Up @@ -850,4 +875,4 @@ APPLY_FOR_METRICS(MAKE_METRIC_ENUM_M, MAKE_METRIC_ENUM_F)
GET_METRIC(family, metric_max) \
.Set(std::max(GET_METRIC(family, metric_max).Value(), GET_METRIC(family, metric).Value())); \
SCOPE_EXIT({ GET_METRIC(family, metric).Decrement(); })
} // namespace DB
} // namespace DB
Loading