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

[statspro] Avoid stopping the world during stats updates #8335

Merged
merged 4 commits into from
Sep 6, 2024

Conversation

max-hoffman
Copy link
Contributor

The stats provider holds a lock that was required to (1) update stats, and (2) access statistics.

The new behavior

  • Reject duplicate update requests on the same database/branch/table. So an analyze table <t> will error if a conflicting job is active.
  • Only lock the provider in critical sections. Update threads only grab the lock to read current statistics or write updates. So regular reads/writes will not hang waiting for the stats provider mutex longer than it takes to finish a critical section.

@coffeegoddd
Copy link
Contributor

@max-hoffman DOLT

comparing_percentages
100.000000 to 100.000000
version result total
bd138e7 ok 5937457
version total_tests
bd138e7 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Contributor

@max-hoffman DOLT

comparing_percentages
100.000000 to 100.000000
version result total
f0b4e71 ok 5937457
version total_tests
f0b4e71 5937457
correctness_percentage
100.0

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM, no notes

@max-hoffman max-hoffman merged commit 9a590a3 into main Sep 6, 2024
21 checks passed
@max-hoffman max-hoffman deleted the max/no-blocking-stats branch September 6, 2024 21:37
Copy link

github-actions bot commented Sep 7, 2024

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.05 1.6
batching batch sql 10000 1 0.07 1.86
batching by line sql 10000 1 0.07 2
blob 1 blob 200000 1 0.89 3.89 3.62
blob 2 blobs 200000 1 0.89 4.42 4.39
blob no blob 200000 1 0.92 2.37 1.96
col type datetime 200000 1 0.82 3.01 2.8
col type varchar 200000 1 0.67 3.49 2.82
config width 2 cols 200000 1 0.77 2.83 2.03
config width 32 cols 200000 1 1.85 1.98 2.46
config width 8 cols 200000 1 1 2.29 1.97
pk type float 200000 1 0.84 2.38 1.88
pk type int 200000 1 0.8 2.5 1.94
pk type varchar 200000 1 1.5 1.76 1.37
row count 1.6mm 1600000 1 5.69 2.9 2.26
row count 400k 400000 1 1.45 2.76 2.16
row count 800k 800000 1 2.82 2.9 2.27
secondary index four index 200000 1 3.59 1.39 1.04
secondary index no secondary 200000 1 0.91 2.4 2
secondary index one index 200000 1 1.12 2.41 1.96
secondary index two index 200000 1 1.93 1.8 1.45
sorting shuffled 1mm 1000000 0 5.2 2.77 2.41
sorting sorted 1mm 1000000 1 5.32 2.71 2.3

Copy link

github-actions bot commented Sep 7, 2024

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.23
dolt_blame_commit_filter system table 3.33
dolt_commit_ancestors_commit_filter system table 0.81
dolt_commits_commit_filter system table 1
dolt_diff_log_join_from_commit system table 2.04
dolt_diff_log_join_to_commit system table 2.04
dolt_diff_table_from_commit_filter system table 1.17
dolt_diff_table_to_commit_filter system table 1.17
dolt_diffs_commit_filter system table 0.89
dolt_history_commit_filter system table 1.43
dolt_log_commit_filter system table 1.05

Copy link

github-actions bot commented Sep 7, 2024

@coffeegoddd DOLT

name add_cnt delete_cnt update_cnt latency
adds_only 60000 0 0 0.72
adds_updates_deletes 60000 60000 60000 3.77
deletes_only 0 60000 0 1.87
updates_only 0 0 60000 2.42

Copy link

github-actions bot commented Sep 8, 2024

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.06 1.5
batching batch sql 10000 1 0.08 1.63
batching by line sql 10000 1 0.08 1.75
blob 1 blob 200000 1 0.9 3.77 3.49
blob 2 blobs 200000 1 0.88 4.41 4.35
blob no blob 200000 1 0.9 2.41 1.99
col type datetime 200000 1 0.83 2.95 2.72
col type varchar 200000 1 0.7 3.27 2.7
config width 2 cols 200000 1 0.78 2.54 1.94
config width 32 cols 200000 1 1.89 1.93 2.34
config width 8 cols 200000 1 0.98 2.35 2.82
pk type float 200000 1 0.89 2.64 1.78
pk type int 200000 1 0.78 2.74 1.96
pk type varchar 200000 1 1.62 1.59 1.28
row count 1.6mm 1600000 1 5.72 2.86 2.25
row count 400k 400000 1 1.43 2.81 2.18
row count 800k 800000 1 2.84 2.87 2.23
secondary index four index 200000 1 3.53 1.38 1.05
secondary index no secondary 200000 1 0.88 2.41 2.03
secondary index one index 200000 1 1.12 2.41 1.97
secondary index two index 200000 1 1.98 1.73 1.36
sorting shuffled 1mm 1000000 0 4.99 2.82 2.33
sorting sorted 1mm 1000000 1 5.03 2.78 2.26

Copy link

github-actions bot commented Sep 8, 2024

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.23
dolt_blame_commit_filter system table 3.32
dolt_commit_ancestors_commit_filter system table 0.84
dolt_commits_commit_filter system table 1.1
dolt_diff_log_join_from_commit system table 2.02
dolt_diff_log_join_to_commit system table 2.02
dolt_diff_table_from_commit_filter system table 1.13
dolt_diff_table_to_commit_filter system table 1.19
dolt_diffs_commit_filter system table 0.96
dolt_history_commit_filter system table 1.32
dolt_log_commit_filter system table 1.21

Copy link

github-actions bot commented Sep 8, 2024

@coffeegoddd DOLT

name add_cnt delete_cnt update_cnt latency
adds_only 60000 0 0 0.73
adds_updates_deletes 60000 60000 60000 3.79
deletes_only 0 60000 0 1.85
updates_only 0 0 60000 2.36

Copy link

github-actions bot commented Sep 9, 2024

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.06 1.33
batching batch sql 10000 1 0.07 1.86
batching by line sql 10000 1 0.07 1.86
blob 1 blob 200000 1 0.9 3.8 3.46
blob 2 blobs 200000 1 0.89 4.35 4.3
blob no blob 200000 1 0.88 2.43 2.07
col type datetime 200000 1 0.84 2.92 2.69
col type varchar 200000 1 0.68 3.34 2.78
config width 2 cols 200000 1 0.8 2.45 1.9
config width 32 cols 200000 1 1.85 2 2.34
config width 8 cols 200000 1 1 2.29 1.93
pk type float 200000 1 1.2 1.65 1.32
pk type int 200000 1 0.97 2.05 1.58
pk type varchar 200000 1 1.97 1.42 1.06
row count 1.6mm 1600000 1 5.65 2.9 2.22
row count 400k 400000 1 1.47 2.74 2.11
row count 800k 800000 1 2.9 2.81 2.16
secondary index four index 200000 1 3.61 1.36 1.04
secondary index no secondary 200000 1 0.91 2.36 1.95
secondary index one index 200000 1 1.13 2.36 1.9
secondary index two index 200000 1 1.93 1.78 1.45
sorting shuffled 1mm 1000000 0 5.1 2.76 2.21
sorting sorted 1mm 1000000 1 5.12 2.76 2.2

Copy link

github-actions bot commented Sep 9, 2024

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.22
dolt_blame_commit_filter system table 3.32
dolt_commit_ancestors_commit_filter system table 0.81
dolt_commits_commit_filter system table 1.1
dolt_diff_log_join_from_commit system table 2.02
dolt_diff_log_join_to_commit system table 2.05
dolt_diff_table_from_commit_filter system table 1.13
dolt_diff_table_to_commit_filter system table 1.16
dolt_diffs_commit_filter system table 0.86
dolt_history_commit_filter system table 1.33
dolt_log_commit_filter system table 1.1

Copy link

github-actions bot commented Sep 9, 2024

@coffeegoddd DOLT

name add_cnt delete_cnt update_cnt latency
adds_only 60000 0 0 0.72
adds_updates_deletes 60000 60000 60000 3.79
deletes_only 0 60000 0 1.87
updates_only 0 0 60000 2.4

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