Bit Flip Resilient Prefix Tree
Total Page:16
File Type:pdf, Size:1020Kb
Master thesis Database Group Bit Flip Resilient Prefix Tree Supervisors: Author: Prof. Dr.-Ing Wolfgang Lehner, Mina Ahmadi Dr.-Ing. Dirk Habich, Dipl.-Inf. Till Kolditz February 2016 Aufgabenstellung ¢£¤¥¦§ © © ¤¦ £ £ ¨ Master’s Thesis Description !"#$%&'()* +,-./,-0 102.3-4 526-0,40 7,52 7073-8 9:-3;<:=;9 ,2. 6,=,6598 >8 .06-0,452< 9-,245493- ?0,9;-0 45@04A B:5C0 9:54 ,C43 526-0,404 020-<8 0??5650268D 320 .-,/>,6E 54 9:0 .06-0,40 52 -0C5,>5C598 ,2. ,2 526-0,40 52 :,-./,-0 0--3- -,904A F20 =,-956;C,- 0??069 54 9:0 >59 ?C5=D /:56: 6,;404 , 452<C0 3- 7;C95=C0 >594 93 6:,2<0 9:0 49,90 .;0 93 4010-,C 52?C;0260 C5E0 :0,9D 634756 -,84 3- 0C069-56,C 6-3449,CEA GC-0,.8 93.,8D 9:0-0 ,-0 49;.504 -010,C52< 4010-0 7;C95H>59 ?C5= -,904 52 C,-<0 637=;90- 4849074D /:56: 6,2239 >0 :,2.C0. >8 98=56,C 0--3- .0906952< ,2. 63--06952< IJKKL 7,52 7073-8A M010-9:0C044D 9:54 :,-./,-0 9-02. ,CC3/0. 9:0 .010C3=7029 3? 7,52H7073-8 6029-56 .,9,>,40 4849074 73-0 9:,2 , .06,.0 ,<3A N:040 4849074 493-0 ,CC >;452044 .,9, 52 7,52 7073-8D /:0-0,4 9:08 E00= 4010-,C ,..59532,C .,9, 49-;69;-04 93 7,2,<0 ,CC 9:0 .,9, ,2. ,660C0-,90 ,66044 93 9:0 .,9, 15, 52.0O 49-;69;-04A F? 9:0 C,990-D 320 ?,75C8 -06029C8 =-3=340. ?3- ;40 52 ,2,C8956,C /3-EC3,.4 54 9:0 =-0?5O 9-00 PQR /:340 7,52 6:,-,690-549564 ,-0 9:,9 59 .515.04 , E08 5293 =-0?5O04 ,2. 9:,9 59 0O6044510C8 ;404 =35290-4A S59 ?C5= .09069532 /,4 ,C-0,.8 =-3=340. ?3- 52H7073-8 SH9-004 PTRA UVVWX#"YX') U&Z" [2.0O 49-;69;-04 ,-0 32C8 320 =3-9532 3? , .,9,>,40 484907 /:56: 200. 93 >0 :,-.020. ,<,5249 >59 ?C5=4A N:54 54 -0\;5-0. 93 >0 ,>C0 93 >020?59 ?-37 ?;9;-0 :,-./,-0 <020-,95324 ,2. 63=0 /59: 526-0,452< 0--3- -,904A ]'VX# N:0 <3,C 3? 9:54 9:0454 54 93 5210495<,90 70,24 93 .09069 ,2. 63--069 >59 ?C5= 0--3-4 ?3- 9:0 =-0?5O 9-00 52.0O 49-;69;-0A N:0 49;.029 54 0263;-,<0. 93 6:3340 320 :,-./,-0 ?,5C;-0 73.0C -0407>C52< 6;--029 3- ?;9;-0 >59 ?C5= -,904A ^5-49D ,==-3,6:04 ?3- , <020-,C =-0?5O 9-00 49-;69;-0 4:3;C. >0 0O,7520.A N:02D 9:0 49;.029 4:,CC 63245.0- 906:25\;04 ?3- 3=9575@0. =-0?5O 9-00 1,-5,294A _-,/>,6E4 52 9:-3;<:=;9 ,2. 7073-8 ?339=-529 ,-0 93 >0 70,4;-0. ,2. 9:0 ;40 3? `[a_ 5249-;695324 7;49 >0 -0<,-.0.A bZcZ&Z)#Zd PQR N:37,4 e54452<0-D S02f,752 `6:C0<0CD _5-E +,>56:D B3C?<,2< g0:20-h ijjNh i;0-8 j-3604452< 32 j-0?5O N-004A [2h j-3600.52<4 3? 9:0 k9: S50225,C K32?0-0260 32 [2231,9510 _,9, `849074 l040,-6: IK[_l TmQnD G45C37,-D K,C5?3-25,D o`GLA PTR N5CC e3C.59@D N:37,4 e54452<0-D S02f,752 `6:C0<0CD _5-E +,>56:D B3C?<,2< g0:20-h F2C520 >59 ?C5= .09069532 ?3- 52H7073-8 SH9-004 32 ;2-0C5,>C0 :,-./,-0A [2h pqrsttuvwxy rz {|t }tw{| ~w{tqw{vrw rqy|r rw { wxttw{ rw t quqt ~ wt wrvqu {| ¡ 2 Declaration of Authorship I, Mina Ahmadi, declare that this master's thesis entitled 'Bit Flip Re- silient Prefix Tree' is my own work. All information published and written by another person is acknowledged and referenced in the bibliography. Dresden, 1st of February 2016 3 Abstract Detecting bit flips in index structures of databases is an important issue. Nowadays, index structures reside in memory in order to avoid accessing the disk and make processes of databases faster. Since size of the memories are big enough nowadays, there is no problem to keep the indexes in memory but in case of bit flip occurrence, we would like to detect them to avoid accessing a part of memory which is not allocated or accessing wrong values. When bit flip happens, bits can change from 0 to 1 or vice versa. Bit flips can happen because of multiple reasons. Sometimes bit flips are transient, so they will go away after a reboot, but sometimes they will not change at all. The index structure which is going to be explored is prefix tree. In this thesis, parity bits are used for the pointers in the tree in the first step. In the second step, memory allocation for the prefix tree is done in a way, so that locating the nodes is possible through some calculations and any bit flips can be detected by any mismatch between the calculation and the existing pointers. In the third step, prefix tree is implemented in a way to reduce the memory accesses but bit flip detection is done in the same way as in the second step. Based on the results of these implementations, bit flips can be detected by using parity bits if the number of bit flips on a byte is odd. In the imple- mentations on the second and third step, any number of bit flips could be detected. There were some memory allocation issues in both of the methods which resulted in high memory consumption when a lot of keys were inserted into the tree, but a reasonable solution for that is given at the end of the thesis. 4 Acknowledgement Firstly, I would like to express my sincere gratitude to my advisor Dipl.-inf. Till Kolditz for the support of my master thesis, for his patience, motivation, and immense knowledge. Besides my advisor, I would like to thank the rest of my thesis committee: Prof. Dr.-Ing. Wolfgang Lehner and Dr.-Ing. Dirk Habich. Last but not the least, I would like to thank my family, my parents, my brothers, my sister and my friends for supporting me spiritually throughout writing this thesis and my life in general. 5 Contents List of Figures 10 List of Tables 12 1 Introduction 13 1.1 Motivation . 13 1.2 Objectives . 14 1.3 Structure of the Thesis . 14 2 Background and Related Works 15 2.1 Background . 15 2.1.1 What is Bit Flip? . 15 2.1.2 Types of Error . 15 2.1.3 Soft Errors Detection Mechanisms . 16 2.2 Related Works . 17 2.2.1 A Study of Index Structures for Main Memory Database Management Systems . 17 2.2.2 KISS-Tree: Small Latch-Free In-Memory Indexing on Modern Architectures . 21 2.2.3 CTrie . 22 2.2.4 Burst Trie . 23 2.2.5 Online Bit Flip Detection for In-Memory B-Trees on Unreliable Hardware . 25 2.2.6 Efficient Verification of B-tree Integrity . 28 6 2.2.7 Efficient In-Memory Indexing with Generalized Prefix Trees . 29 2.3 Summary . 31 3 Methodologies 32 3.1 Basic Structure of Prefix Tree . 33 3.2 Prefix Tree with Parity Bits . 34 3.3 New Layout for Node Storage in Prefix Tree . 36 3.3.1 Density of Tree . 36 3.3.2 Creation of Tree . 37 3.3.3 Insertion of Bit Flips . 38 3.3.4 Evaluation . 38 3.4 Structure of Prefix Tree with Less Memory Access . 39 3.4.1 Structure of Tree . 39 3.4.2 Insertion in Tree . 41 3.4.3 Insertion of Bit Flips . 43 3.4.4 Value Retrieval from Tree . 44 3.5 Summary . 46 4 Implementation 47 4.1 Implementation of Basic Prefix Tree . 47 4.2 Prefix Tree with Parity Bits . 48 4.3 New Layout for Node Storage in Prefix Tree . 51 4.3.1 Density of Tree . 51 4.3.2 Creation of the Dense Tree . 53 4.3.3 Insertion of Bit Flips . 54 4.3.4 Evaluation . 54 4.4 Implementation of Prefix Tree with Less Memory Accesses . 55 4.4.1 Insertion . 57 4.4.2 Bit Flip Insertion . 58 4.4.3 Retrieving Values from Tree . 60 4.5 Summary . 61 5 Evaluation and Future Work 62 5.1 Evaluation . 62 5.2 Future Work . 69 7 6 Bibliography 71 8 List of Figures 2.1 Extendible Hashing . 19 2.2 C-Trie Insertion . 23 2.3 Burst trie after insertion of a number of keys . 24 3.1 Overall structure of the thesis . 33 3.2 Traverse the tree for finding value of key 200 . 34 3.3 Tree structure . 41 3.4 Insertion of keys into the tree . 43 3.5 Value retrieval from tree . 45 4.1 Setting parity bits for the pointers . 49 4.2 Checking parity bits of the pointers . 50 4.3 Number of created nodes after using Poisson distribution for key creation . 52 4.4 Number of created nodes after using Uniform int distribution for key creation . 52 4.5 Number of created nodes after using keys which are multiples of three . 53 4.6 Virtual memory allocation for the first, second and third level 56 4.7 Insertion of bit flip in key-value pairs, nodes and flag bytes in the tree .