Console View
|
Categories: connectors experimental galera main |
|
| connectors | experimental | galera | main | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yuchen Pei
ycp@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-15621 Auto add RANGE COLUMNS partitions by interval Allow auto partitioning by interval in PARTITION BY RANGE COLUMNS PARTITION BY RANGE COLUMNS (col_name) INTERVAL interval [AUTO] ( PARTITION partition_name VALUES LESS THAN (value) [, PARTITION partition_name VALUES LESS THAN (value) ... ] ) where - col_name is the name of one column of type DATE or DATETIME - at least one partition is supplied - INTERVAL interval is a time interval When performing DML on such a table, it will first add partitions by the specified interval until the partition covers the current time. Partition addition will not cause an implicit commit like DDL normally does. The partitions are named pN. Otherwise the table behaves exactly the same as a normal RANGE COLUMNS partitioned table. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hemant Dangi
hemant.dangi@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
High priority MDL_BACKUP_COMMIT_HIGH_PRIO and Slave-side BACKUP-COMMIT tracking to prevent parallel-slave/backup deadlock A parallel-slave worker holding MDL_BACKUP_COMMIT and waiting on a prior commit can deadlock with an incoming BACKUP STAGE BLOCK_COMMIT: the prior commit also needs MDL_BACKUP_COMMIT but fairness denies it while the backup X-request is in the waiting queue. Add MDL_BACKUP_COMMIT_HIGH_PRIO — a sibling of MDL_BACKUP_COMMIT whose only matrix difference is that it is granted past a waiting backup X. Compatibility with already-granted holders is unchanged. The slave decides at request time, via per-Relay_log_info state in Backup_commit_team (every in-flight teammate plus the subset that picked C but is not yet granted). The atomic join_and_decide() rule: Pick HIGH_PRIO iff (a) some larger-sub_id teammate is registered, AND (b) no smaller-sub_id teammate is currently pending-C. Otherwise pick MDL_BACKUP_COMMIT and mark pending-C. (a) breaks the deadlock. (b) prevents a larger sub_id from being granted H while a smaller is queued as C behind X — which would re-deadlock through wait_for_prior_commit. Atomicity closes the register/decide race. mark_granted() clears pending-C on grant; leave() cleans up on release or error. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yuchen Pei
ycp@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MDEV-15621 [demo] Allow PARTITION BY RANGE COLUMNS of a timestamp column | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
improve MTR bootstrap performance on slow disk use --debug-no-sync to workaround slow disk flush. On Github actions Windows ARM64, this alone cuts the test time from ca 55 min to ca 45 min. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Georgi (Joro) Kodinov
joro@mariadb.org |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39718: Produce Markdown plugin API documentation Implemented a cmake utility macro to generate markdown documentation for the plugin API headers. Fixed some doxygen comment mistakes in these. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yuchen Pei
ycp@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-15621 Auto add RANGE COLUMNS partitions by interval Allow auto partitioning by interval in PARTITION BY RANGE COLUMNS PARTITION BY RANGE COLUMNS (col_name) INTERVAL interval [AUTO] ( PARTITION partition_name VALUES LESS THAN (value) [, PARTITION partition_name VALUES LESS THAN (value) ... ] ) where - col_name is the name of one column of type DATE or DATETIME - at least one partition is supplied - INTERVAL interval is a time interval When performing DML on such a table, it will first add partitions by the specified interval until the partition covers the current time. Partition addition will not cause an implicit commit like DDL normally does. The partitions are named pN. Otherwise the table behaves exactly the same as a normal RANGE COLUMNS partitioned table. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yuchen Pei
ycp@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-15621 [refactor] Partitioning cleanup change p_column_list_val::fixed to a bool remove redundant end label in partition_info::fix_column_value_functions |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
sjaakola
seppo.jaakola@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-38260 applier hang due to sequence table access Avoiding to mark sequence table write as a DDL transaction for galera applying. Skipping commit for DDL marked GTID log event in applying as this would lead to double commit, if the transaction has also a real transaction. Such scnenario could happen if transaction has sequence table writes together with other innodb table writes. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Rex Johnston
rex.johnston@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39492 Parallel Query: Study how to create worker threads Introduces parallel_worker_threads variable to control the number of worker threads created by a parallel execution query. 2 new files, sql_parallel_workers.h sql_parallel_workers.cc which contain structures for the creation, management and deletion of parallel worker threads (pwt_ in the name). Main management class created in the stack in JOIN::exec, implemented for the top level select. Current parallel_worker_thread_func sleeps for 10 seconds, generates a warning, signals the main thread, sleeps 10 seconds, signals the main thread again, sets it's finished flag and cleans it's THD. The main thread loops through worker threads, looking for finished thread and cleans them up if they have finished. It then waits for a signal, then processes it's message queue. Threads are registed in server_threads, so are visible in information_schema.processlist and the show processlist command. We check that a kill query on a parallel worker is passed onto it's manager and the query is properly aborted, and that a kill connection is handled properly in parallel_worker.test. Review input 1: cleanup earlier Do cleanup before we've finished sending the result to the client. This way, one can see the errors (and eventually warnings) marshalled back to the main thread and returned to the user: MariaDB [test]> set parallel_worker_threads=10; Query OK, 0 rows affected (0.001 sec) MariaDB [test]> select seq from seq_1_to_10; ERROR 4103 (HY000): Argument to the worker_busted_function() function does not belong to the range [0,1] Assisted by Sergei Petrunia and Claude Code. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
bsrikanth-mariadb
srikanth.bondalapati@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39538: Different costs when same range is read twice When same range is used as a filter, once in the outer query block, and the second inside a sub query such as: - select * from t1 where year(a) = 2010 and c < (select count(*) from t1 where year(a) = 2010); The Optimizer Context had two records for multi_range_read_info_const() call, but had different cost vector members. The cause is that the first table considered index-only scan on the range, while the second considered non-index only scan. However, when replaying the context, the same range got matched twice, and the costs corresponding to that got returned twice. Hence the costs in the explain plan output differed as well. Solution ======== Include a new field called "call_number", while recording range contexts into the overall context. This way, we could even match the call_number and return the appropriate cost during replay. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Marko Mäkelä
marko.makela@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Re-enable 3 tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Marko Mäkelä
marko.makela@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
fixup! 2a7950aa1cfdd4bb212eec4317b7bea4e24c830b FIXME: Sometimes we have both a hard-linked ib_*.log and ib_logfile101 with identical contents. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PranavKTiwari
pranav.tiwari@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-28610 : Assertion marked_for_read() failed upon range select with virtual column in index. Fix read_set propagation for virtual columns during keyread The keyread initialization path was populating using , which internally uses the non-recursive index marking path. This only marks direct index fields and does not resolve dependencies of virtual/generated columns. As a result, when a covering index contained a virtual column, its dependent base columns could be missing from , leading to assertions during virtual column evaluation. Replace the call with , which uses the recursive read-marking path and correctly propagates virtual/generated column dependencies into during keyread setup. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Rex Johnston
rex.johnston@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39492 Parallel Query: Study how to create worker threads Introduces parallel_worker_threads variable to control the number of worker threads created by a parallel execution query. 2 new files, sql_parallel_workers.h sql_parallel_workers.cc which contain structures for the creation, management and deletion of parallel worker threads (pwt_ in the name). Main management class created in the stack in JOIN::exec, implemented for the top level select. Current parallel_worker_thread_func sleeps for 10 seconds, generates a warning, signals the main thread, sleeps 10 seconds, signals the main thread again, sets it's finished flag and cleans it's THD. The main thread loops through worker threads, looking for finished thread and cleans them up if they have finished. It then waits for a signal, then processes it's message queue. Threads are registed in server_threads, so are visible in information_schema.processlist and the show processlist command. We check that a kill query on a parallel worker is passed onto it's manager and the query is properly aborted, and that a kill connection is handled properly in parallel_worker.test. Review input 1: cleanup earlier Do cleanup before we've finished sending the result to the client. This way, one can see the errors (and eventually warnings) marshalled back to the main thread and returned to the user: MariaDB [test]> set parallel_worker_threads=10; Query OK, 0 rows affected (0.001 sec) MariaDB [test]> select seq from seq_1_to_10; ERROR 4103 (HY000): Argument to the worker_busted_function() function does not belong to the range [0,1] Assisted by Sergei Petrunia and Claude Code. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yuchen Pei
ycp@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-15621 Auto add RANGE COLUMNS partitions by interval Allow auto partitioning by interval in PARTITION BY RANGE COLUMNS PARTITION BY RANGE COLUMNS (col_name) INTERVAL interval [AUTO] ( PARTITION partition_name VALUES LESS THAN (value) [, PARTITION partition_name VALUES LESS THAN (value) ... ] ) where - col_name is the name of one column of type DATE or DATETIME or TIMESTAMP - at least one partition is supplied - INTERVAL interval is a time interval When performing DML on such a table, it will first add partitions by the specified interval until the partition covers the current time. Partition addition will not cause an implicit commit like DDL normally does. The partitions are named pN. Otherwise the table behaves exactly the same as a normal RANGE COLUMNS partitioned table. Note that TIMESTAMP is not allowed as a type for PARTITION BY RANGE COLUMNS otherwise. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39719 Fix memory allocation errors on Windows ARM64 CI Do not overload the machine. Huge reservation seem to stress Windows on ARM64 memory management, so that random OOM can appear when multiple processes are constantly allocating/deallocating memory. Reduce number of parallel threads to 2. The bottleneck on this machine is disk IO, so it does not reduce total test time. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
improve MTR bootstrap performance on slow disk use --debug-no-sync to workaround slow disk flush. On Github actions Windows ARM64, this alone cuts the test time from ca 55 min to ca 45 min. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| x | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PranavKTiwari
pranav.tiwari@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Added code change. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alexey Botchkov
holyfoot@askmonty.org |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Progress on 26.05.26. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Andrei Elkin
andrei.elkin@pp.inet.fi |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-36025 Parallel slave concurrent BACKUP MDL locking with ongoing backup.. The problem the patch tackles is that the binlogging parallel slave can expose prepared state of transactions to the backup process. That is the latter can enroll such transactions, typically waiting for prior commits - in other words *undecided* (of whether they are going to commit at all - sic!), into backup image. The technical possibility of that owes to earlier deadlocks fixes in this area that made the parallel slave worker to re-acquire its BACKUP MDL within the wait-for-prior commit phase (which is post- engine prepare) one. Note the --skip-log-bin or --log-slave-update=OFF parallel slave is not vulnerable to the exposure of its prepared transactions. The fixes this patch provides make sure the backup image contains only transactions that are (binlog-order) committed, while parallel slave does not deadlock (MDEV-23586). The principal part of the fixes implements leapfrogging of a waiting "high-priority" BACKUP MDL by a slave parallel worker which is exemplified in the following. First mind about notations: here (as elsewhere in the patch) `Fn` group commit followers indexed by the gtid seq-no `n`; `F|xyz` indicates the execution status (timing) of the MDL request. `B` - stands for backup thread; `Si,Xk` are BACKUP share and exclusive MDL sequenced by `i,k` that are logical times of the MDL acquisition; The semi-column separates the granted head of the lock queue from the waiters. The queue below is the BACKUP MDL queue. | which initially is | | [Initial Queue State] | GRANTED ; WAITING QUEUE | ---------------------------------- | S1(F2) ; X2(B) | | Next it receives | <- Incoming Request: S3(L1) | the scheduler having the following context | [Scheduler Evaluation] | Requestor: L1 (gtid_sub_id = 1) | Holder : F2 (gtid_sub_id = 2) | Condition: holder->gtid_sub_id > requestor->gtid_sub_id (2 > 1) -> TRUE! | Action : ignore_mdl_priority = true. L1 bypasses the waiting X2 lock. | | decides where to place it | | [Final Queue State] | GRANTED ; WAITING QUEUE | ---------------------------------- | S1(F2), S3(L1) ; X2(B) | so it chooses to team up L1,F2 correctly. Any next S4(F_n), where n > 2 | won't be granted which means F_n will wait for the backup completion. | Like this | | [Final Queue State] | GRANTED ; WAITING QUEUE | ---------------------------------- | S1(F2), S3(L1) ; X2(B),S4(F3) The decision to allow S3 leapfrog X2 requires the current lock holder F2 to have a greater gtid_sub_id (2 > 1). To implement this scheduling policy requires the following modifications. P1 sql/mdl.h The new method determines whether a BACKUP lock requester is a teammate of a group that can share the MDL lock and that there exists at least on granted member of the group. +MDL_request::bool (*is_teammate_callback)(const THD*, const THD*); P2. sql/log.cc dismantling of mdl_context.{release,acquire}_lock() in the parallel worker wait-for-prior commit P3. sql/handler.cc setting the P1 MDL_request::is_teammate_callback to the slave parallel worker as hint to try acquiring the MDL lock by team membership. P4. sql/rpl_rli.cc defines the teammate callback for the parallel slave. +rpl_group_info::ignore_mdl_priority P5. sql/handler.cc Logics of "careful" release of the MDL lock could not be streamlined. The failed parallel slave worker still has to abide with the former policy of ``` as there is extra replication book-keeping to be done before rolling back and allowing a conflicting transaction to continue (MDEV-7458).``` [ha_commit_trans]. For that reason of MDEV-7458 the BACKUP MDL request's memory is now allocated for the worker in THD::st_transaction::mem_root. Also guards are deployed to not let the mem-root be be cleaned too early, before the lock gets released. It can be released fast to follow with transaction->cleanup() for not failing trx:s. Failing to commit parallel workers defer that to Relay_log_info::cleanup_context() from where now ha_rollback_trans() will make it. Aslo necessary changes are caused by to the gtid implicit statement's design. 1. sql/sql_class.cc Removed earlier backup-on-parallel-slave bugfixes of MDEV-23586. The parallel worker does not release anymore BACKUP MDL at its wait-for-prior commit stage. 2. sql/sql_lex.h, sql/sql_base.cc, sql/rpl_gtid.cc Has to be introduced +#define TL_OPTION_GTID_TABLE_SLAVE 64 as a part of a method to find out (see open_table() hunk) at executing record_gtid() by implicit GTID statement that its BACKUP MDL lock (however it is necessary - it is not challenged here) needs the ignore-priority hint. Note this hint applies for granting a "special" S' share locked not yet the commit time ha_commit_trans()'s MDL_BACKUP_COMMIT (denoted as S) lock, which is going to be requested later. Let's exemplify it on the following diagrams, calling S' a sort of shared lock, compatible with with S of the commit time. *Without* the teammate hint the request for S'3(F2) at record_gtid() time S1(F3|wait_for_prior_commit); X2(B) <- S'3(F2|record_gtid) would end up to wait behind X2 S1; /* waiting */ X2, S'3 and we'd be regress back to hang/deadlock of earlier bugs: F3 would not be awaken by F2 who is blocked by B. Tested with extended set of parallel slave with backup scenarios. This commit must require more and extensive testing and may cause followup amendments, through review comments as well. Co-authored-with: [email protected]. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thirunarayanan Balathandayuthapani
thiru@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-34358 Encryption threads consume CPU when no work available Problem: ======== 1. Encryption threads busy-wait when no work is available. When reaching fil_system.space_list.end(), fil_crypt_return_iops() is called with wake=true, causing pthread_cond_broadcast() to wake all threads unnecessarily, leading to CPU waste. 2. Tablespaces with CLOSING/STOPPING flags (set during DDL operations) are skipped during iteration. Since DDL completion doesn't wake encryption threads, these spaces may never be encrypted if threads sleep indefinitely. 3. For default_encrypt_list iteration, when spaces exist but none are acquirable, threads need to wake others for cooperative retry, but this case was not distinguished from fil_system.space_list.end(). 4. IOPS are allocated before searching for tablespaces, wasting resources during iteration when no I/O occurs. 5. Encryption threads use fil_crypt_threads_cond for two different purposes: waiting for encryption work and waiting for IOPS allocation. When fil_crypt_return_iops() or fil_crypt_realloc_iops() broadcasts after releasing IOPS, it wakes ALL threads including those correctly waiting for work, causing spurious wakeups and CPU waste. 6. When innodb_encrypt_tables or innodb_encryption_rotate_key_age is changed during encryption thread iteration, threads continue with stale configuration values, potentially missing tablespaces that should be encrypted or rotated under the new settings. Solution: ========= 1. Implement timed wait with exponential backoff when space == fil_system.space_list.end() (applies to both default_encrypt_list and space_list iteration when no acquirable spaces are found): - First timeout: 5 seconds - Subsequent timeouts: (timed_wait_count + 1) * 5 seconds (10s, 20s, 40s, 60s) - After 5 consecutive timeouts (~135 seconds total), continue with 60-second timed waits to ensure threads periodically recheck for state changes without requiring explicit signals - Timeout counter resets to 0 when woken by signal (config change, new tablespace) or when work is found 2. Move IOPS allocation from before tablespace search to after finding a space that needs rotation. If allocation fails, set recheck=true to skip waiting and immediately try next space. 3. Introduce separate condition variable fil_crypt_iops_cond specifically for IOPS allocation synchronization to prevent spurious wakeups: - fil_crypt_threads_cond: Used in wait_for_work() for waiting when no tablespaces need encryption. Signaled when settings change, new tablespaces are created, or thread count changes. - fil_crypt_iops_cond (NEW): Used in fil_crypt_alloc_iops() for waiting when IOPS limit is reached. Signaled when IOPS are returned via fil_crypt_return_iops(), released via fil_crypt_realloc_iops(), or when srv_n_fil_crypt_iops is increased. 4. Added atomic version counter fil_crypt_settings_version that is incremented whenever innodb_encrypt_tables or innodb_encryption_rotate_key_age changes. Encryption threads capture the version at iteration start and check for changes during iteration. If config changed, threads immediately restart iteration from the beginning to ensure complete coverage with new settings. fil_crypt_settings_version: Atomic counter to track the innodb_encrypt_tables or innodb_encryption_rotate_key_age changes rotate_thread_t::timed_wait_count (uint8_t): Counts consecutive timeouts for exponential backoff rotate_thread_t::wait_for_work(): Implements timed/indefinite wait strategy rotate_thread_t::settings_version: To compare the existing fil_crypt_settings_version to restart the encryption from the beginning |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Daniel Black
daniel@mariadb.org |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-37664: main.lotofstack fails with MSAN+Debug Under MSAN+Debug this test case exceeds the stack early without the stack detection mechanism to identify that it passed its limit. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Raghunandan Bhat
raghunandan.bhat96@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39227: Schema Versioning - Server-side - SQL layer infrastructure for multiple versions of a table definition. - No storage engine changes; any DDLs that depends on the engine or .frm re-write for persistance is not yet supported. - binlog/replication, DDL log for crash recovery are not supported yet. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PranavKTiwari
pranav.tiwari@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-28610 : Assertion marked_for_read() failed upon range select with virtual column in index. Fix read_set propagation for virtual columns during keyread The keyread initialization path was populating using , which internally uses the non-recursive index marking path. This only marks direct index fields and does not resolve dependencies of virtual/generated columns. As a result, when a covering index contained a virtual column, its dependent base columns could be missing from , leading to assertions during virtual column evaluation. Replace the call with , which uses the recursive read-marking path and correctly propagates virtual/generated column dependencies into during keyread setup. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39719 Fix memory allocation errors on Windows ARM64 CI Do not overload the machine. Huge reservation seem to stress Windows on ARM64 memory management, so that random OOM can appear when multiple processes are constantly allocating/deallocating memory. Reduce number of parallel threads to 2. The bottleneck on this machine is disk IO, so it does not reduce total test time. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Marko Mäkelä
marko.makela@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Implement compatible copy_file() on macOS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thirunarayanan Balathandayuthapani
thiru@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-34358 Encryption threads consume CPU when no work available Problem: ======== The InnoDB encryption thread could deadlock with purge or DML operations when rotating encryption keys. The encryption thread called fseg_page_is_allocated() to check if a page was allocated before encrypting it. This function acquired an exclusive latch (fil_space_t::latch) on the tablespace to read the allocation bitmap. However, purge or DML threads could already be holding page latches while waiting to acquire the same tablespace latch, creating a lock order violation. Specifically, the encryption thread would hold the tablespace latch and then try to acquire a page latch, while purge held a page latch and tried to acquire the tablespace latch, resulting in a deadlock. Solution: ========= fseg_page_is_allocated(): Encryption thread passes an mtr, allocation bitmap page latch is now correctly held in that mtr until the caller commits it. fil_crypt_get_page_throttle(): Use a trylock mechanism to acquire the tablespace exclusive latch non-blockingly. If the trylock fails, back off and retry the same page to avoid deadlock. The bitmap page S-latch is added to the mtr and held throughout the page read and encryption operations. Release the tablespace exclusive latch immediately after the allocation check to minimize contention, while the bitmap page S-latch remains held in the mtr. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Georgi (Joro) Kodinov
joro@mariadb.org |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39718: Produce Markdown plugin API documentation Implemented a cmake utility macro to generate markdown documentation for the plugin API headers. Fixed some doxygen comment mistakes in these. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Andrei Elkin
andrei.elkin@pp.inet.fi |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
High priority MDL_BACKUP_BLOCK_COMMIT_RPL When the standard request of MDL_BACKUP_COMMIT is not granted to a worker it first searches for a possible grantee that is a parallel slave worker and if there exist one with greater commit order the request type is escalate to the highest which is re-submitted. To the changes in sql_base.cc, note there also exist a request of the highest (new) type at time of Xid_apply_log_event::do_record_gtid which is a committing phase of slave transaction when it is executing an implicit statement. It must be able to bypass any waiting lock by backup process even without yet knowing whether the transaction is going to be enrolled into a pending to commit slave group. When later it turns out not the case the strong MDL_STATEMENT requested lock would've been already relinquished. Tested with previous commit's refined and extended BASE's rpl.parallel_backup, rpl.rpl_parallel_backup_worker_retry and new added rpl.rpl_parallel_backup_waits_worker_retry Todo: According to Svoj's review, this patch still needs removing the slave specific code from the MDL. That is changes in MDL_context::acquire_lock(). Probably ha_commit_trans() would call first try_acquire_lock_impl() when it returns empty ticket a part of the added to acquire_lock Teammate-Aware Escalation Check would be invoked just to compute `has_teammate` and when that is true to call the whole BASE version of MDL_context::acquire_lock() having the highest type of request. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alexey Botchkov
holyfoot@askmonty.org |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fix to the XMLTYPE. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39719 Fix memory allocation errors on Windows ARM64 CI Do not overload the machine. Huge reservation seem to stress Windows on ARM64 memory management, so that random OOM can appear when multiple processes are constantly allocating/deallocating huge chunks of memory. Thus, reduce number of parallel threads to 2, and do not run replication tests. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
PranavKTiwari
pranav.tiwari@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| removed inlin. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Marko Mäkelä
marko.makela@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| InnoDB_backup::fini(): Trim to the same log file size | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alexey Botchkov
holyfoot@askmonty.org |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Progress report. 17.04.2026 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Alexander Barkov
bar@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39518 Allow prepared statements in stored functions in assignment right hand In progress |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
bsrikanth-mariadb
srikanth.bondalapati@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39538: Different costs when same range is read twice When same range is used as a filter, once in the outer query block, and the second inside a sub query such as: - select * from t1 where year(a) = 2010 and c < (select count(*) from t1 where year(a) = 2010); The Optimizer Context had two records for multi_range_read_info_const() call, but had different cost vector members. The cause is that the first table considered index-only scan on the range, while the second considered non-index only scan. However, when replaying the context, the same range got matched twice, and the costs corresponding to that got returned twice. Hence the costs in the explain plan output differed as well. Solution ======== Include a new field called "call_number", while recording range contexts into the overall context. This way, we could even match the call_number and return the appropriate cost during replay. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Vladislav Vaintroub
vvaintroub@gmail.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39719 Fix memory allocation errors on Windows ARM64 CI Do not overload the machine. Huge reservation seem to stress Windows on ARM64 memory management, so that random OOM can appear when multiple processes are constantly allocating/deallocating memory. Reduce number of parallel threads to 2. The bottleneck on this machine is disk IO, so it does not reduce total test time. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Rex Johnston
rex.johnston@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MDEV-39492 Parallel Query: Study how to create worker threads Introduces parallel_worker_threads variable to control the number of worker threads created by a parallel execution query. 2 new files, sql_parallel_workers.h sql_parallel_workers.cc which contain structures for the creation, management and deletion of parallel worker threads (pwt_ in the name). Main management class created in the stack in JOIN::exec, implemented for the top level select. Current parallel_worker_thread_func sleeps for 10 seconds, generates a warning, signals the main thread, sleeps 10 seconds, signals the main thread again, sets it's finished flag and cleans it's THD. The main thread loops through worker threads, looking for finished thread and cleans them up if they have finished. It then waits for a signal, then processes it's message queue. Threads are registed in server_threads, so are visible in information_schema.processlist and the show processlist command. We check that a kill query on a parallel worker is passed onto it's manager and the query is properly aborted, and that a kill connection is handled properly in parallel_worker.test. Review input 1: cleanup earlier Do cleanup before we've finished sending the result to the client. This way, one can see the errors (and eventually warnings) marshalled back to the main thread and returned to the user: MariaDB [test]> set parallel_worker_threads=10; Query OK, 0 rows affected (0.001 sec) MariaDB [test]> select seq from seq_1_to_10; ERROR 4103 (HY000): Argument to the worker_busted_function() function does not belong to the range [0,1] Assisted by Sergei Petrunia and Claude Code. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Marko Mäkelä
marko.makela@mariadb.com |
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Fix a regression in mtr_t::is_named_space | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||