[MDEV-3841] LevelDB storage engine Created: 2012-11-08 Updated: 2019-11-26 Resolved: 2013-10-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Implement a LevelDB storage engine. Basic feature list:
The spec is being worked on here: https://kb.askmonty.org/en/leveldb-storage-engine |
| Comments |
| Comment by Sergei Petrunia [ 2012-11-08 ] |
|
Put more content into the spec (not finished still). |
| Comment by Sergei Petrunia [ 2012-11-08 ] |
|
tbleveldb storage engine compiles succesfully, but crashes when one tries to create a table. It gets a SIGSEGV in leveldb::DBImpl::NewDB, the line new_db.SetComparatorName(user_comparator()->Name()); has user_comparator() == NULL. |
| Comment by Sergei Petrunia [ 2012-11-09 ] |
|
More updates to https://kb.askmonty.org/en/leveldb-storage-engine/, it's shaping up |
| Comment by Sergei Petrunia [ 2012-11-09 ] |
|
More updates to the spec. Will be ready for another call early next week. |
| Comment by Sergei Petrunia [ 2012-11-12 ] |
|
Discussion with Sergei about possible needed changes in SE API. He has pointed out that TokuDB has similar properties (e.g. INSERT works faster if it does not have to check whether it is inserting a duplicate) |
| Comment by Sergei Petrunia [ 2012-12-11 ] |
|
Got the basic do-nothing storage engine to work. The tree is on launchpad, at lp:~maria-captains/maria/mysql-5.6-leveldb |
| Comment by Sergei Petrunia [ 2012-12-12 ] |
|
I've hit an interesting problem when writing key comparator function. According to the design, the key is "dbname.table_name.$primary_key_value", and $primary_key_value is encoded in MySQL's KeyTupleFormat. It is easy to compare values in KeyTupleFormat when one has the TABLE object for the table in question. But we do not necessarily have it. It is possible that LevelDB invokes the comparator when the table has not been open yet (for example, compaction process may do so). To be exact, we don't need TABLE object, we need Field_xxx objects that describe the indexed columns. Field objects have int Field::key_cmp(const uchar *a,const uchar *b) function that performs comparisons for all types. Possible solutions are: InnoDB implements S1, for the most part. It stores internally key column attributes like field length, null-ability, whether it is unsigned, etc. It still relies on MySQL to handle some of the types. I got an idea about S3 when looking at make_field() in sql/field.cc, the one with signature like this: Field *make_field(TABLE_SHARE *share, uchar *ptr, uint32 field_length, If LeveDB SE stored all of the attributes of the function, it would be able to create Field* objects of its own. |
| Comment by Sergei Petrunia [ 2012-12-12 ] |
|
Discussed the problem with SergeiG. Results : There is also S4 /* not listed above but implied */ Convert keys into something that can be compared with memcmp(). The problem: index-only scans will not be possible, there is strxfrm() is available for strings, but not for int/double/decimal/etc. S3 can be improved: MyISAM/Aria use ha_key_cmp() to compare key values. That function either compares key tuples directly, or it uses the result of _mi_pack_key(). Using that is better than messing with TABLE_SHARE and Field objects. |
| Comment by Sergei Petrunia [ 2012-12-14 ] |
|
Was implementing S3. Finally came to the following cset (just pushed to launchpad):
Blob columns are not supported yet. |
| Comment by Sergei Petrunia [ 2012-12-15 ] |
|
Investigated how storage engine should handle blob columns.
When blob data is passed down into handler::write_row(), the blob is alloced and owned by SQL layer. Callee copies the data, but doesn't free. |
| Comment by Sergei Petrunia [ 2012-12-18 ] |
|
Got blob handling to work (at least, basic tests pass). |
| Comment by Sergei Petrunia [ 2012-12-19 ] |
|
Got UPDATE and DELETE commands to work for simple examples. (They don't work for complex examples because right now all changes are applied immediately) |
| Comment by Zheng Shao [ 2013-01-12 ] |
|
Hi Sergei, how's going so far? |
| Comment by Sergei Petrunia [ 2013-01-12 ] |
|
I'm still working on implementing row-locking system and hooking it to ha_leveldb. (More details in the email) |
| Comment by Aris Setyawan (Inactive) [ 2013-10-31 ] |
|
Hi Sergei, In which version of MariaDB, LevelDB storage engine will be released? |
| Comment by Sergei Petrunia [ 2013-11-06 ] |
|
Hi Aris, Current status is that a tree (based on mysql-5.6) with the engine is available. The engine has a number of known limitations that make it difficult for it to compete against a more feature-complete engine like InnoDB. Right now, I cannot say which version of MariaDB the engine will be pushed to. |
| Comment by zhan mu qiao [ 2019-11-24 ] |
|
Hi Sergei |
| Comment by Sergei Petrunia [ 2019-11-24 ] |
|
Hi Vessel, are you sure you need LevelDB storage engine? It was a prototype which didn't reach the production stage. It was a basis for RocksDB storage engine, which is a part of MariaDB Server starting from version 10.2. |
| Comment by zhan mu qiao [ 2019-11-24 ] |
|
Hi,Sergei |
| Comment by Sergei Petrunia [ 2019-11-24 ] |
|
Ok, I hope I'm not mixing anything up, The latest tree that I can find with LevelDB code is this one: https://code.launchpad.net/~maria-captains/maria/mysql-5.6-leveldb |
| Comment by Elena Stepanova [ 2019-11-24 ] |
|
Please keep in mind that MariaDB doesn't support this engine, branch or code to any level, there will be no bugfixes, development, consultation or guidance in regard to it. |
| Comment by zhan mu qiao [ 2019-11-26 ] |
|
Hi Sergei |
| Comment by zhan mu qiao [ 2019-11-26 ] |
|
Hi Elena |