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

RONDB-780: Increased max batch size from 992 to 4000 except for scans… #577

Merged
merged 10 commits into from
Dec 4, 2024
4 changes: 2 additions & 2 deletions cmake/ssl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ FUNCTION(FIND_CUSTOM_OPENSSL)

FIND_LIBRARY(OPENSSL_LIBRARY
NAMES ssl libssl ssleay32 ssleay32MD
HINTS ${OPENSSL_ROOT_DIR}/lib ${OPENSSL_ROOT_DIR}/lib64)
HINTS ${OPENSSL_ROOT_DIR}/lib64 ${OPENSSL_ROOT_DIR}/lib)
FIND_LIBRARY(CRYPTO_LIBRARY
NAMES crypto libcrypto libeay32
HINTS ${OPENSSL_ROOT_DIR}/lib ${OPENSSL_ROOT_DIR}/lib64)
HINTS ${OPENSSL_ROOT_DIR}/lib64 ${OPENSSL_ROOT_DIR}/lib)

IF(OPENSSL_INCLUDE_DIR)
FIND_OPENSSL_VERSION()
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/ndb/r/ndbinfo_plans.result
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ndb$disk_write_speed_base 488 48
ndb$diskpagebuffer 10 64
ndb$diskstat 10 48
ndb$diskstats_1sec 200 52
ndb$error_messages 865 52
ndb$error_messages 867 52
ndb$frag_locks 400 96
ndb$frag_mem_use 400 100
ndb$frag_operations 400 192
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/ndb_binlog/r/ndb_binlog_basic.result
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ inserts updates deletes
flush logs;
purge binary logs before now();
Warnings:
Warning 1868 file ./binlog.000002 was not purged because it is the active log file.
Warning 1869 file ./binlog.000002 was not purged because it is the active log file.
select count(*) from mysql.ndb_binlog_index;
count(*)
0
Expand Down
260 changes: 42 additions & 218 deletions mysql-test/suite/ndb_quota/ndb_basic.result
Original file line number Diff line number Diff line change
@@ -1,222 +1,4 @@
DATABASE QUOTA SET successfully executed
SHOW GLOBAL STATUS LIKE 'ndb\_%';
Variable_name Value
Ndb_api_adaptive_send_deferred_count #
Ndb_api_adaptive_send_deferred_count_replica #
Ndb_api_adaptive_send_deferred_count_session #
Ndb_api_adaptive_send_deferred_count_slave #
Ndb_api_adaptive_send_forced_count #
Ndb_api_adaptive_send_forced_count_replica #
Ndb_api_adaptive_send_forced_count_session #
Ndb_api_adaptive_send_forced_count_slave #
Ndb_api_adaptive_send_unforced_count #
Ndb_api_adaptive_send_unforced_count_replica #
Ndb_api_adaptive_send_unforced_count_session #
Ndb_api_adaptive_send_unforced_count_slave #
Ndb_api_bytes_received_count #
Ndb_api_bytes_received_count_replica #
Ndb_api_bytes_received_count_session #
Ndb_api_bytes_received_count_slave #
Ndb_api_bytes_sent_count #
Ndb_api_bytes_sent_count_replica #
Ndb_api_bytes_sent_count_session #
Ndb_api_bytes_sent_count_slave #
Ndb_api_event_bytes_count #
Ndb_api_event_bytes_count_injector #
Ndb_api_event_data_count #
Ndb_api_event_data_count_injector #
Ndb_api_event_nondata_count #
Ndb_api_event_nondata_count_injector #
Ndb_api_pk_op_count #
Ndb_api_pk_op_count_replica #
Ndb_api_pk_op_count_session #
Ndb_api_pk_op_count_slave #
Ndb_api_pruned_scan_count #
Ndb_api_pruned_scan_count_replica #
Ndb_api_pruned_scan_count_session #
Ndb_api_pruned_scan_count_slave #
Ndb_api_range_scan_count #
Ndb_api_range_scan_count_replica #
Ndb_api_range_scan_count_session #
Ndb_api_range_scan_count_slave #
Ndb_api_read_row_count #
Ndb_api_read_row_count_replica #
Ndb_api_read_row_count_session #
Ndb_api_read_row_count_slave #
Ndb_api_scan_batch_count #
Ndb_api_scan_batch_count_replica #
Ndb_api_scan_batch_count_session #
Ndb_api_scan_batch_count_slave #
Ndb_api_table_scan_count #
Ndb_api_table_scan_count_replica #
Ndb_api_table_scan_count_session #
Ndb_api_table_scan_count_slave #
Ndb_api_trans_abort_count #
Ndb_api_trans_abort_count_replica #
Ndb_api_trans_abort_count_session #
Ndb_api_trans_abort_count_slave #
Ndb_api_trans_close_count #
Ndb_api_trans_close_count_replica #
Ndb_api_trans_close_count_session #
Ndb_api_trans_close_count_slave #
Ndb_api_trans_commit_count #
Ndb_api_trans_commit_count_replica #
Ndb_api_trans_commit_count_session #
Ndb_api_trans_commit_count_slave #
Ndb_api_trans_local_read_row_count #
Ndb_api_trans_local_read_row_count_replica #
Ndb_api_trans_local_read_row_count_session #
Ndb_api_trans_local_read_row_count_slave #
Ndb_api_trans_start_count #
Ndb_api_trans_start_count_replica #
Ndb_api_trans_start_count_session #
Ndb_api_trans_start_count_slave #
Ndb_api_uk_op_count #
Ndb_api_uk_op_count_replica #
Ndb_api_uk_op_count_session #
Ndb_api_uk_op_count_slave #
Ndb_api_wait_exec_complete_count #
Ndb_api_wait_exec_complete_count_replica #
Ndb_api_wait_exec_complete_count_session #
Ndb_api_wait_exec_complete_count_slave #
Ndb_api_wait_meta_request_count #
Ndb_api_wait_meta_request_count_replica #
Ndb_api_wait_meta_request_count_session #
Ndb_api_wait_meta_request_count_slave #
Ndb_api_wait_nanos_count #
Ndb_api_wait_nanos_count_replica #
Ndb_api_wait_nanos_count_session #
Ndb_api_wait_nanos_count_slave #
Ndb_api_wait_scan_result_count #
Ndb_api_wait_scan_result_count_replica #
Ndb_api_wait_scan_result_count_session #
Ndb_api_wait_scan_result_count_slave #
Ndb_cluster_node_id #
Ndb_config_from_host #
Ndb_config_from_port #
Ndb_config_generation #
Ndb_conflict_epoch_delete_delete_count #
Ndb_conflict_fn_epoch #
Ndb_conflict_fn_epoch2 #
Ndb_conflict_fn_epoch2_trans #
Ndb_conflict_fn_epoch_trans #
Ndb_conflict_fn_max #
Ndb_conflict_fn_max_del_win #
Ndb_conflict_fn_max_del_win_ins #
Ndb_conflict_fn_max_ins #
Ndb_conflict_fn_old #
Ndb_conflict_last_conflict_epoch #
Ndb_conflict_last_stable_epoch #
Ndb_conflict_reflected_op_discard_count #
Ndb_conflict_reflected_op_prepare_count #
Ndb_conflict_refresh_op_count #
Ndb_conflict_trans_conflict_commit_count #
Ndb_conflict_trans_detect_iter_count #
Ndb_conflict_trans_reject_count #
Ndb_conflict_trans_row_conflict_count #
Ndb_conflict_trans_row_reject_count #
Ndb_connect_count #
Ndb_execute_count #
Ndb_fetch_table_stats #
Ndb_index_stat_cache_clean #
Ndb_index_stat_cache_query #
Ndb_index_stat_event_count #
Ndb_index_stat_status #
Ndb_last_commit_epoch_server #
Ndb_last_commit_epoch_session #
Ndb_log_purge_queue_size #
Ndb_log_purged_files #
Ndb_log_purged_rows #
Ndb_metadata_detected_count #
Ndb_metadata_excluded_count #
Ndb_metadata_synced_count #
Ndb_number_of_data_nodes #
Ndb_number_of_ready_data_nodes #
Ndb_pruned_scan_count #
Ndb_pushed_queries_defined #
Ndb_pushed_queries_dropped #
Ndb_pushed_queries_executed #
Ndb_pushed_reads #
Ndb_replica_max_replicated_epoch #
Ndb_scan_count #
Ndb_schema_locks_count #
Ndb_slave_max_replicated_epoch #
Ndb_sorted_scan_count #
Ndb_system_name #
Ndb_trans_hint_count_session #
SHOW GLOBAL VARIABLES WHERE Variable_name LIKE 'ndb\_%' and
Variable_name NOT LIKE 'ndb_dbg\_%';
Variable_name Value
ndb_allow_copying_alter_table #
ndb_applier_allow_skip_epoch #
ndb_applier_conflict_role #
ndb_autoincrement_prefetch_sz #
ndb_batch_size #
ndb_blob_read_batch_bytes #
ndb_blob_write_batch_bytes #
ndb_clear_apply_status #
ndb_cluster_connection_pool #
ndb_cluster_connection_pool_nodeids #
ndb_connectstring #
ndb_data_node_neighbour #
ndb_default_column_format #
ndb_deferred_constraints #
ndb_distribution #
ndb_eventbuffer_free_percent #
ndb_eventbuffer_max_alloc #
ndb_extra_logging #
ndb_force_send #
ndb_fully_replicated #
ndb_index_stat_enable #
ndb_index_stat_option #
ndb_join_pushdown #
ndb_log_apply_status #
ndb_log_bin #
ndb_log_binlog_index #
ndb_log_empty_epochs #
ndb_log_empty_update #
ndb_log_exclusive_reads #
ndb_log_fail_terminate #
ndb_log_orig #
ndb_log_purge_rate #
ndb_log_transaction_compression #
ndb_log_transaction_compression_level_zstd #
ndb_log_transaction_dependency #
ndb_log_transaction_id #
ndb_log_update_as_write #
ndb_log_update_minimal #
ndb_log_updated_only #
ndb_metadata_check #
ndb_metadata_check_interval #
ndb_metadata_sync #
ndb_mgm_tls #
ndb_mgmd_host #
ndb_nodeid #
ndb_optimization_delay #
ndb_optimized_node_selection #
ndb_read_backup #
ndb_recv_thread_activation_threshold #
ndb_recv_thread_cpu_mask #
ndb_replica_batch_size #
ndb_replica_blob_write_batch_bytes #
ndb_report_thresh_binlog_epoch_slip #
ndb_report_thresh_binlog_mem_usage #
ndb_row_checksum #
ndb_schema_dist_lock_wait_timeout #
ndb_schema_dist_timeout #
ndb_schema_dist_upgrade_allowed #
ndb_show_foreign_key_mock_tables #
ndb_slave_conflict_role #
ndb_table_no_logging #
ndb_table_temporary #
ndb_tls_search_path #
ndb_use_copying_alter_table #
ndb_use_exact_count #
ndb_use_transactions #
ndb_version #
ndb_version_string #
ndb_wait_connected #
ndb_wait_setup #
CREATE TABLE t1 (
pk1 INT NOT NULL PRIMARY KEY,
attr1 INT NOT NULL,
Expand Down Expand Up @@ -1138,4 +920,46 @@ ENGINE=ndb;
show warnings;
Level Code Message
drop table t1;
select node_id, remote_node_id, type
from ndbinfo.transporter_details
order by node_id, remote_node_id;
node_id remote_node_id type
1 2 TCP
1 2 TCP
1 2 TCP
1 2 TCP
1 3 TCP
1 16 TCP
1 32 TCP
1 48 TCP
1 49 TCP
1 63 TCP
1 127 TCP
1 192 TCP
1 228 TCP
1 229 TCP
1 230 TCP
1 231 TCP
1 232 TCP
1 233 TCP
1 255 TCP
2 1 TCP
2 1 TCP
2 1 TCP
2 1 TCP
2 3 TCP
2 16 TCP
2 32 TCP
2 48 TCP
2 49 TCP
2 63 TCP
2 127 TCP
2 192 TCP
2 228 TCP
2 229 TCP
2 230 TCP
2 231 TCP
2 232 TCP
2 233 TCP
2 255 TCP
DATABASE QUOTA DROP successfully executed
5 changes: 1 addition & 4 deletions storage/ndb/compile-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,7 @@ if(! -d "$opt_srcdir/libmysqld")
if ($opt_with_zlib_dir ne "bundled");
push(@args, "-DWITH_ZLIB=$opt_with_zlib_dir");
}
if($opt_with_ssl)
{
push(@args, "-DWITH_SSL=".($opt_with_ssl ? "yes" : "wolfssl"));
}
push(@args, "-DWITH_SSL=/usr/local/ssl");
if ($opt_localstatedir)
{
push(@args, "-DMYSQL_DATADIR=$opt_localstatedir");
Expand Down
10 changes: 6 additions & 4 deletions storage/ndb/include/kernel/ndb_limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,13 @@
* API can order a multiple of this number of records at a time since
* fragments can be scanned in parallel.
*/
#define MAX_PARALLEL_OP_PER_SCAN 992
#define MAX_PARALLEL_OP_PER_SCAN_WITH_LOCK 992
#define MAX_PARALLEL_OP_PER_SCAN_SPJ 4000
#define MAX_PARALLEL_OP_PER_SCAN_RC 4000
/*
* The default batch size. Configurable parameter.
*/
#define DEF_BATCH_SIZE 256
#define DEF_BATCH_SIZE 384
/*
* When calculating the number of records sent from LQH in each batch
* one uses SCAN_BATCH_SIZE divided by the expected size of signals
Expand All @@ -209,14 +211,14 @@
* signals.
* This parameter is configurable, this is the default value.
*/
#define SCAN_BATCH_SIZE 16384
#define SCAN_BATCH_SIZE 32768
/*
* To protect the NDB API from overload we also define a maximum total
* batch size from all nodes. This parameter should most likely be
* configurable, or dependent on sendBufferSize.
* This parameter is configurable, this is the default value.
*/
#define MAX_SCAN_BATCH_SIZE 262144
#define MAX_SCAN_BATCH_SIZE 524288
/*
* Maximum number of Parallel Scan queries on one hash index fragment
*/
Expand Down
15 changes: 10 additions & 5 deletions storage/ndb/include/ndbapi/NdbReceiver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,16 @@ class NdbReceiver {
void getValues(const NdbRecord *, char *);
void prepareSend();

static void calculate_batch_size(const NdbImpl &, Uint32 parallelism,
Uint32 &batch_size, Uint32 &batch_byte_size);

void calculate_batch_size(Uint32 parallelism, Uint32 &batch_size,
Uint32 &batch_byte_size) const;
static void calculate_batch_size(const NdbImpl &,
Uint32 parallelism,
Uint32 &batch_size,
Uint32 &batch_byte_size,
Uint32 def_max_batch_size);

void calculate_batch_size(Uint32 parallelism,
Uint32 &batch_size,
Uint32 &batch_byte_size,
Uint32 def_max_batch_size) const;

/**
* Calculate size of result buffer which has to be
Expand Down
2 changes: 1 addition & 1 deletion storage/ndb/plugin/ha_ndbcluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9009,7 +9009,7 @@ int ha_ndbcluster::get_old_table_comment_items(THD *thd,
if (mod_fully_replicated->m_found)
comment_items_shown[FULLY_REPLICATED] = true;
if (mod_frags->m_found) comment_items_shown[PARTITION_BALANCE] = true;
if (mod_ttl) {
if (mod_ttl->m_found) {
comment_items_shown[TTL] = true;
}
return 0;
Expand Down
4 changes: 3 additions & 1 deletion storage/ndb/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ ENDFOREACH()
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(mgmapi)
ADD_SUBDIRECTORY(ndbapi)
ADD_SUBDIRECTORY(ronsql)
IF(WITH_RDRS)
ADD_SUBDIRECTORY(ronsql)
ENDIF()

#
# Build static ndbclient library
Expand Down
Loading