[MDEV-12458] Variable and log records to indicate RocksDB version are missing Created: 2017-04-06  Updated: 2018-01-17  Resolved: 2018-01-17

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - RocksDB
Affects Version/s: 10.2.5, 10.2.6
Fix Version/s: 10.2.12

Type: Bug Priority: Minor
Reporter: Valerii Kravchuk Assignee: Varun Gupta (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

Usually we see versions for storage engines used in MariaDB 10.2 represented by separate variables:

MariaDB [test]> show variables like '%version%';
+-------------------------+----------------------------------+
| Variable_name           | Value                            |
+-------------------------+----------------------------------+
| innodb_version          | 5.7.14                           |
| protocol_version        | 10                               |
| slave_type_conversions  |                                  |
| tokudb_version          | 5.6.35-80.0                      |
| version                 | 10.2.6-MariaDB                   |
| version_comment         | Source distribution              |
| version_compile_machine | x86_64                           |
| version_compile_os      | Linux                            |
| version_malloc_library  | system                           |
| version_ssl_library     | OpenSSL 1.0.2k-fips  26 Jan 2017 |
| wsrep_patch_version     | wsrep_25.16                      |
+-------------------------+----------------------------------+
11 rows in set (0.00 sec)
 
MariaDB [test]> show engines;
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                                          | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| ROCKSDB            | YES     | RocksDB storage engine                                                           | YES          | YES  | YES        |
| MRG_MyISAM         | YES     | Collection of identical MyISAM tables                                            | NO           | NO   | NO         |
| CSV                | YES     | CSV storage engine                                                               | NO           | NO   | NO         |
| SEQUENCE           | YES     | Generated tables filled with sequential values                                   | YES          | NO   | YES        |
| MyISAM             | YES     | MyISAM storage engine                                                            | NO           | NO   | NO         |
| TokuDB             | YES     | Percona TokuDB Storage Engine with Fractal Tree(tm) Technology                   | YES          | YES  | YES        |
| MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables                        | NO           | NO   | NO         |
| InnoDB             | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES          | YES  | YES        |
| Aria               | YES     | Crash-safe tables with MyISAM heritage                                           | NO           | NO   | NO         |
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                                               | NO           | NO   | NO         |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
10 rows in set (0.00 sec)

See innodb_version and tokudb_version above. I think rocksdb_version is clearly missing.

We do not have version reported in the error log also:

2017-04-06 13:54:24 139839357302848 [Note] /home/openxs/dbs/maria10.2/bin/mysqld: ready for connections.
Version: '10.2.6-MariaDB'  socket: '/tmp/mariadb.sock'  port: 3306  Source distribution
2017-04-06 13:55:43 139838786844416 [Note] RocksDB: Got ENOENT when listing column families
2017-04-06 13:55:43 139838786844416 [Note] RocksDB:   assuming that we're creating a new database
2017-04-06 13:55:43 139838786844416 [Note] RocksDB: Column Families at start:
2017-04-06 13:55:43 139838786844416 [Note]   cf=default
2017-04-06 13:55:43 139838786844416 [Note]     write_buffer_size=67108864
2017-04-06 13:55:43 139838786844416 [Note]     target_file_size_base=67108864
2017-04-06 13:55:43 139838786844416 [Note] RocksDB: creating a column family __system__
2017-04-06 13:55:43 139838786844416 [Note]     write_buffer_size=67108864
2017-04-06 13:55:43 139838786844416 [Note]     target_file_size_base=67108864
2017-04-06 13:55:43 139838786844416 [Note] RocksDB: Table_store: loaded DDL data for 0 tables
2017-04-06 13:55:44 139838786844416 [Note] RocksDB: global statistics using get_sched_indexer_t indexer
2017-04-06 13:55:44 139838786844416 [Note] RocksDB instance opened

"Upstream" Facebook's MySQL 5.6 has at least the following for rocksdb:

mysql> show status like '%rocksdb%';
+------------------+------------------------------------------+
| Variable_name    | Value                                    |
+------------------+------------------------------------------+
| rocksdb_git_date | 2017-03-16T18:24:17-07:00                |
| rocksdb_git_hash | d52f334cbd4bceee23f13470f137220c8a75686b |
+------------------+------------------------------------------+
2 rows in set (0.00 sec)



 Comments   
Comment by Sergei Petrunia [ 2017-12-22 ]

I get this for the upstream:

MySQL [(none)]> show status like '%git%';
+------------------+------------------------------------------+
| Variable_name    | Value                                    |
+------------------+------------------------------------------+
| git_date         | %cI                                      |
| git_hash         | 5969a3ef953cbd7838581c4553edb11c341ec174 |
| rocksdb_git_date | %cI                                      |
| rocksdb_git_hash | 019aa7074ceadffd6fb871f96465b3785370901f |
+------------------+------------------------------------------+

Apparently, my version of git doesn't recognize "%cI".

Comment by Sergei Petrunia [ 2017-12-22 ]

... and the reason we haven't got it together with the rest of MyRocks is that they define it at the SQL layer in sql/mysqld.cc.

Comment by Sergei Petrunia [ 2017-12-22 ]

MariaDB 10.3 also has these version status variables:

| version_source_revision | feec04f29db95e9e43b68fbea4592a66f591626a |
| version_ssl_library     | OpenSSL 1.0.1f 6 Jan 2014                |

so there's code somewhere that gets a git revision in a way that's portable across everywhere MariaDB is built...

Comment by Sergei Petrunia [ 2017-12-22 ]

Quoting serg


but anyway, no objections as long as you don't put a date of the build or something else that makes builds not repeatable

Comment by Varun Gupta (Inactive) [ 2017-12-29 ]

http://lists.askmonty.org/pipermail/commits/2017-December/011766.html

Comment by Sergei Petrunia [ 2017-12-29 ]

Ok to push after adjusting the description

Comment by Daniel Black [ 2018-01-01 ]

varun, 7703095d2e26a15d4ecbd3683f9779b97f851c98 fails to build with out of tree builds as the generated header file is in the build dir not the source dir.

$ pwd
/home/dan/software_projects/build-mariadb-10.2
...
make -j8
...
/home/dan/software_projects/mariadb-10.2/storage/rocksdb/ha_rocksdb.cc:73:35: fatal error: ./rdb_source_revision.h: No such file or directory
 #include "./rdb_source_revision.h"

Comment by Daniel Black [ 2018-01-02 ]

This is a sufficient fix:

diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index dd23304..5810412 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -6,6 +6,7 @@ endif()
 SET(ROCKSDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb)
 
 INCLUDE_DIRECTORIES(
+  ${CMAKE_CURRENT_BINARY_DIR}
   ${ROCKSDB_SOURCE_DIR}
   ${ROCKSDB_SOURCE_DIR}/include
   ${ROCKSDB_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src

Comment by Varun Gupta (Inactive) [ 2018-01-02 ]

Thanks danblack for noticing this glitch

Comment by Sergei Petrunia [ 2018-01-12 ]

There is no rocksdb_deadlock_detect_depth_basic.result file. Also, that test needs a --replace command to not print the hash value.

Generated at Thu Feb 08 07:57:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.