[MDEV-17171] Bug: RocksDB Tables do not have "Creation Date" Created: 2018-09-11  Updated: 2020-08-25  Resolved: 2019-11-04

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - RocksDB
Affects Version/s: 10.3.9
Fix Version/s: 10.3.19, 10.4.9

Type: Bug Priority: Blocker
Reporter: Juan Telleria Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: upstream, upstream-fixed
Environment:

Windows



 Description   

If you execute:

SHOW TABLE STATUS;

In a Database with RocksDB Tables, you will see that RocksDB Tables never contain:

  • Create_time
  • Update_time
  • Check_time

But InnoDB Table do.

Could this be fixed please?

Thank you.



 Comments   
Comment by Sergei Petrunia [ 2019-09-06 ]

An observation by marko : in InnoDB, the Update_time is non-persistent, the data is only stored in InnoDB's in-memory structure. (This is important, as maintaining a fast-changing value on disk would cause IO overhead or require some clever tricks).

Check_time is always NULL for InnoDB tables.

Comment by Sergei Petrunia [ 2019-09-06 ]

Checked if upstream FB/MySQL 5.6 have implemented this feature - no, they don't have it.

Comment by Sergei Petrunia [ 2019-09-06 ]

The patch was pushed to https://github.com/MariaDB/server/tree/bb-10.4-mdev17171 , waiting for BB pass for it.

Comment by Sergei Petrunia [ 2019-09-07 ]

Pull request against FB/MySQL-5.6 upstream : https://github.com/facebook/mysql-5.6/pull/1046

Comment by Sergei Petrunia [ 2019-09-18 ]

Got a question, what is/should happen with create_time when somebody runs ALTER TABLE ?

Trying it on InnoDB

mysql> create table t1 (pk int, a int, b int, c int) engine=innodb;
Query OK, 0 rows affected (0.03 sec)
 
mysql> insert into t1 (pk) values (1);
Query OK, 1 row affected (0.00 sec)
 
mysql> select create_time, update_time, check_time  from information_schema.tables where table_schema=database() and table_name='t1';
+---------------------+---------------------+------------+
| create_time         | update_time         | check_time |
+---------------------+---------------------+------------+
| 2019-09-18 17:03:16 | 2019-09-18 17:03:27 | NULL       |
+---------------------+---------------------+------------+
1 row in set (0.00 sec)

mysql> alter table t1 add key(a);
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
mysql> select create_time, update_time, check_time  from information_schema.tables where table_schema=database() and table_name='t1';
+---------------------+---------------------+------------+
| create_time         | update_time         | check_time |                                                                                       
+---------------------+---------------------+------------+                                                                                       
| 2019-09-18 17:03:55 | 2019-09-18 17:03:27 | NULL       |                                                                                       
+---------------------+---------------------+------------+                                                                                       
1 row in set (0.00 sec)                                                                                                                          
                                                                                                                                                 

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2019-09-18 17:04:12 |
+---------------------+
1 row in set (0.00 sec)
 
mysql> alter table t1 drop key a;
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
mysql> select create_time, update_time, check_time  from information_schema.tables where table_schema=database() and table_name='t1';
+---------------------+---------------------+------------+
| create_time         | update_time         | check_time |
+---------------------+---------------------+------------+
| 2019-09-18 17:04:17 | 2019-09-18 17:03:27 | NULL       |
+---------------------+---------------------+------------+
1 row in set (0.01 sec)

So, for in-place ALTER TABLE:

  • create_time is updated
  • update_time does not change

mysql> alter table t1 add primary key (pk);
Query OK, 0 rows affected (0.03 sec)                                                                                                             
Records: 0  Duplicates: 0  Warnings: 0                                                                                                           
                                                                                                                                                 
mysql> select create_time, update_time, check_time  from information_schema.tables where table_schema=database() and table_name='t1';
+---------------------+-------------+------------+                                                                                               
| create_time         | update_time | check_time |                                                                                               
+---------------------+-------------+------------+                                                                                               
| 2019-09-18 17:10:17 | NULL        | NULL       |                                                                                               
+---------------------+-------------+------------+                                                                                               

if ALTER TABLE requires table rebuild:

  • create_time is updated
  • update_time is set to NULL
Comment by Sergei Petrunia [ 2019-09-24 ]

Addressed review input.
Got another kind of input: the updated patch makes the data dictionary backward-incompatible (the new server can read the old datadir; old server will not start on the new datadir). This is not a good thing.

Together with Yoshinori, designed a way to change the data dictionary format so that it is backward and forward- compatible.

Comment by Sergei Petrunia [ 2019-10-15 ]

Setting to Blocker as discussed with serg.

Generated at Thu Feb 08 08:34:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.