summaryrefslogtreecommitdiff
path: root/storage/rocksdb/ha_rocksdb.cc
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-22434 UPDATE on RocksDB table with WITHOUT OVERLAPS failsNikita Malyavin2020-06-051-5/+17
| | | | | | | | | | | | | | | | | | | | Insert worked incorrect as well. RocksDB used table->record[0] internally to store some intermediate results for key conversion, during index searching among other operations. So table->record[0] is spoiled during ha_rnd_index_map in ha_check_overlaps, so in turn the broken record data was inserted. The fix is to store RocksDB intermediate result in its own buffer instead of table->record[0]. `rocksdb` MTR suite is is checked and runs fine. No need for additional tests. The existing overlaps.test covers the case completely. However, I am not going to add anything related to rocksdb to suite, to keep it away from additional dependencies. To run tests with RocksDB engine, one can add following to engines.combinations: [rocksdb] plugin-load=$HA_ROCKSDB_SO default-storage-engine=rocksdb rocksdb
* Merge 10.4 into 10.5Marko Mäkelä2020-05-311-8/+0
|\
| * Merge 10.3 into 10.4Marko Mäkelä2020-05-301-8/+0
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2020-05-291-8/+0
| | |\
| | | * Revert "MDEV-12445 : Rocksdb does not shutdown worker threads and aborts in ↵Sergei Golubchik2020-05-271-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memleak check on server shutdown" This reverts commit 6f1f9114971c3c158e9ac97313c92a24f6554415. because it doesn't do anything now (the server doesn't check my_disable_leak_check) and it never did anything before (because without `extern` it simply created a local instance of my_disable_leak_check, did not affect server's my_disable_leak_check).
* | | | Merge branch '10.4' into 10.5Sergei Golubchik2020-05-091-4/+5
|\ \ \ \ | |/ / /
| * | | MDEV-21794: Optimizer flag rowid_filter leads to long querySergei Petrunia2020-05-071-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rowid Filter check is just like Index Condition Pushdown check: before we check the filter, we must check if we have walked out of the range we are scanning. (If we did, we should return, and not continue the scan). Consequences of this: - Rowid filtering doesn't work for keys that have partially-covered blob columns (just like Index Condition Pushdown) - The rowid filter function has three return values: CHECK_POS (passed) CHECK_NEG (filtered out), CHECK_OUT_OF_RANGE. All of the above is implemented in this patch
* | | | Added page_range to records_in_range() to improve range statisticsMonty2020-03-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prototype change: - virtual ha_rows records_in_range(uint inx, key_range *min_key, - key_range *max_key) + virtual ha_rows records_in_range(uint inx, const key_range *min_key, + const key_range *max_key, + page_range *res) The handler can ignore the page_range parameter. In the case the handler updates the parameter, the optimizer can deduce the following: - If previous range's last key is on the same block as next range's first key - If the current key range is in one block - We can also assume that the first and last block read are cached! This can be used for a better calculation of IO seeks when we estimate the cost of a range index scan. The parameter is fully implemented for MyISAM, Aria and InnoDB. A separate patch will update handler::multi_range_read_info_const() to take the benefits of this change and also remove the double records_in_range() calls that are not anymore needed.
* | | | Replace handler::primary_key_is_clustered() with handler::pk_is_clustering_key()Monty2020-03-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done to both simplify the code and also to be easier to handle storage engines that are clustered on some other index than the primary key. As pk_is_clustering_key() and is_clustering_key now are using only index_flags, these where removed from all storage engines.
* | | | MDEV-742: Fix clang -Winconsistent-missing-overrideMarko Mäkelä2020-03-211-2/+2
| | | |
* | | | MDEV-742 XA PREPAREd transaction survive disconnect/server restartAndrei Elkin2020-03-141-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lifted long standing limitation to the XA of rolling it back at the transaction's connection close even if the XA is prepared. Prepared XA-transaction is made to sustain connection close or server restart. The patch consists of - binary logging extension to write prepared XA part of transaction signified with its XID in a new XA_prepare_log_event. The concusion part - with Commit or Rollback decision - is logged separately as Query_log_event. That is in the binlog the XA consists of two separate group of events. That makes the whole XA possibly interweaving in binlog with other XA:s or regular transaction but with no harm to replication and data consistency. Gtid_log_event receives two more flags to identify which of the two XA phases of the transaction it represents. With either flag set also XID info is added to the event. When binlog is ON on the server XID::formatID is constrained to 4 bytes. - engines are made aware of the server policy to keep up user prepared XA:s so they (Innodb, rocksdb) don't roll them back anymore at their disconnect methods. - slave applier is refined to cope with two phase logged XA:s including parallel modes of execution. This patch does not address crash-safe logging of the new events which is being addressed by MDEV-21469. CORNER CASES: read-only, pure myisam, binlog-*, @@skip_log_bin, etc Are addressed along the following policies. 1. The read-only at reconnect marks XID to fail for future completion with ER_XA_RBROLLBACK. 2. binlog-* filtered XA when it changes engine data is regarded as loggable even when nothing got cached for binlog. An empty XA-prepare group is recorded. Consequent Commit-or-Rollback succeeds in the Engine(s) as well as recorded into binlog. 3. The same applies to the non-transactional engine XA. 4. @@skip_log_bin=OFF does not record anything at XA-prepare (obviously), but the completion event is recorded into binlog to admit inconsistency with slave. The following actions are taken by the patch. At XA-prepare: when empty binlog cache - don't do anything to binlog if RO, otherwise write empty XA_prepare (assert(binlog-filter case)). At Disconnect: when Prepared && RO (=> no binlogging was done) set Xid_cache_element::error := ER_XA_RBROLLBACK *keep* XID in the cache, and rollback the transaction. At XA-"complete": Discover the error, if any don't binlog the "complete", return the error to the user. Kudos ----- Alexey Botchkov took to drive this work initially. Sergei Golubchik, Sergei Petrunja, Marko Mäkelä provided a number of good recommendations. Sergei Voitovich made a magnificent review and improvements to the code. They all deserve a bunch of thanks for making this work done!
* | | | cleanup: pass trxid by valueSergei Golubchik2020-03-101-2/+2
| | | |
* | | | perfschema transaction instrumentation related changesSergei Golubchik2020-03-101-2/+2
| | | |
* | | | perfschema table io instrumentation related changesSergei Golubchik2020-03-101-5/+3
| | | |
* | | | perfschema memory related instrumentation changesSergei Golubchik2020-03-101-13/+14
| | | |
* | | | Merge 10.4 into 10.5Oleksandr Byelkin2019-11-071-5/+4
|\ \ \ \ | |/ / /
| * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-11-011-3/+3
| |\ \ \ | | |/ /
| | * | MDEV-17171: RocksDB Tables do not have "Creation Date"Sergei Petrunia2019-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add SLEEP() calls to the testcase to make it really test that the time doesn't change. - Always use .frm file creation time as a creation timestamp (attempts to re-use older create_time when the table DDL changes are not good because then create_time will change after server restart) - Use the same method names as the upstream patch does - Use std::atomic for m_update_time
| | * | MDEV-17171: RocksDB Tables do not have "Creation Date"bb-10.3-MDEV-17171Sergei Petrunia2019-11-011-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | Variant#5 of the patch: - take creation date from the .frm file, like InnoDB does - Update_time is in-memory only (like in InnoDB).
| * | | MDEV-17171: RocksDB Tables do not have "Creation Date"Sergei Petrunia2019-10-311-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | Variant#5 of the patch: - take creation date from the .frm file, like InnoDB does - Update_time is in-memory only (like in InnoDB).
| * | | MDEV-17171: RocksDB Tables do not have "Creation Date"Sergei Petrunia2019-10-311-38/+0
| | | | | | | | | | | | | | | | Temporarily revert the patch
* | | | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2019-09-111-0/+38
|\ \ \ \ | |/ / /
| * | | MDEV-17171: RocksDB Tables do not have "Creation Date"bb-10.4-mdev17171Sergei Petrunia2019-09-061-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | Support Create_time and Update_time for MyRocks tables. - Create_time is stored in the MyRocks' internal data dictionary. - Update_time is in-memory only (like in InnoDB).
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-08-161-0/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-08-161-2/+2
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Aleksey Midenkov2019-08-141-2/+2
| | |\ \ | | | |/
| | | * MDEV-20315: MyRocks tests produce valgrind failures (Backport to 10.2)Sergei Petrunia2019-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Include the valgrind suppressions from the FB upstream - Use HAVE_Valgrind, not HAVE_Purify (like the rest of MariaDB code does) The call to DisownData() is now actually disabled under Valgrind
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-08-141-0/+2
| |\ \ \ | | |/ /
| | * | Merge 10.2 to 10.3Marko Mäkelä2019-08-131-0/+2
| | |\ \ | | | |/
| | | * MDEV-16955: rocksdb_sys_vars.rocksdb_update_cf_options_basicSergei Petrunia2019-08-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... produces "bytes lost" warnings When rocksdb_validate_update_cf_options() returns an error, the update won't happen. Free the copy of the string in this case.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-08-131-1815/+2165
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-07-251-1/+27
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Eugene Kosov2019-07-161-0/+26
| | |\ \ | | | |/
| | | * Fix rocksdb.autoinc_vars_thread testSergei Petrunia2019-07-151-0/+1
| | | |
| | | * MDEV-14455: rocksdb.2pc_group_commit failed in buildbotSergei Petrunia2019-07-121-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use RocksDB debug sync points to introduce a sync delay. This commits to get grouped even when the datadir is on ramdisk. For some unclear reason the effect is visible on write_prepared but not write_committed, so run the test only with write_prepared.
| | | * Remove unused const TABLE_HASH_SIZEMarko Mäkelä2019-07-031-1/+0
| | | |
| | | * Fix gcc-8 warning in rocksdbRobert Bindar2019-07-031-1/+1
| | | |
| | * | compilation error with gcc 8.3.0Sergei Golubchik2019-07-121-1/+1
| | | | | | | | | | | | | | | | error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
| * | | MDEV-19955 make argument of handler::ha_write_row() constEugene Kosov2019-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-19486 and one more similar bug appeared because handler::write_row() interface welcomes to modify buffer by storage engine. But callers are not ready for that thus bugs are possible in future. handler::write_row(): handler::ha_write_row(): make argument const
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-07-021-1814/+2138
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-07-021-1813/+2138
| | |\ \ | | | |/
| | | * MyRocks: dont show read-Free replication variablesSergei Petrunia2019-06-201-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MariaDB doesn't support Read-Free replication, so showing them only causes confusion. Removed variables: - @@rocksdb_read_free_rpl - @@rocksdb_read_free_rpl_tables
| | | * Post-merge fixes cont'dSergei Petrunia2019-06-161-5/+8
| | | |
| | | * Post-merge fix: fix compilation on WindowsSergei Petrunia2019-06-161-1/+1
| | | |
| | | * Post-merge fixesSergei Petrunia2019-06-161-1/+0
| | | |
| | | * Merge from MyRocks upstream:Sergei Petrunia2019-06-161-1812/+2117
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy of commit dcd9379eb5707bc7514a2ff4d9127790356505cb Author: Manuel Ung <mung@fb.com> Date: Fri Jun 14 10:38:17 2019 -0700 Skip valgrind for rocksdb.force_shutdown Summary: This test does unclean shutdown, and leaks memory. Squash with: D15749084 Reviewed By: hermanlee Differential Revision: D15828957 fbshipit-source-id: 30541455d74
| | | | * Copy ofSergei Petrunia2019-06-151-1834/+2107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit dcd9379eb5707bc7514a2ff4d9127790356505cb Author: Manuel Ung <mung@fb.com> Date: Fri Jun 14 10:38:17 2019 -0700 Skip valgrind for rocksdb.force_shutdown Summary: This test does unclean shutdown, and leaks memory. Squash with: D15749084 Reviewed By: hermanlee Differential Revision: D15828957 fbshipit-source-id: 30541455d74
| | | * | MDEV-17045: MyRocks tables cannot be updated when binlog_format=MIXED.bb-10.2-mdev17045Sergei Petrunia2019-06-151-14/+39
| | | | |
* | | | | MDEV-20315: MyRocks tests produce valgrind failuresSergei Petrunia2019-08-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Include the valgrind suppressions from the FB upstream - Use HAVE_Valgrind, not HAVE_Purify (like the rest of MariaDB code does) The call to DisownData() is now actually disabled under Valgrind
* | | | | Merge 10.4 into 10.5Marko Mäkelä2019-06-201-14/+39
|\ \ \ \ \ | |/ / / /