github.com/zuoyebang/bitalostable@v1.0.1-0.20240229032404-e3b99a834294/testdata/format_major_version_split_user_key_migration (about) 1 define 2 L1 3 d.SET.110:d e.SET.140:e 4 ---- 5 1: 6 000004:[d#110,SET-e#140,SET] points:[d#110,SET-e#140,SET] 7 8 reopen 9 ---- 10 OK 11 12 # The current public Pebble interface offers no way of constructing a multi-file 13 # atomic compaction unit, so use the force-ingest command to force an ingestion 14 # into L1. 15 16 build ef 17 set e e 18 set f f 19 ---- 20 21 force-ingest paths=(ef) level=1 22 ---- 23 1: 24 000004:[d#110,SET-e#140,SET] points:[d#110,SET-e#140,SET] 25 000008:[e#1,SET-f#1,SET] points:[e#1,SET-f#1,SET] 26 27 format-major-version 28 ---- 29 005 30 31 marked-file-count 32 ---- 33 0 files marked for compaction 34 35 ratchet-format-major-version 006 36 ---- 37 38 format-major-version 39 ---- 40 006 41 42 # Upgrading to format major version 006 should've marked files for compaction. 43 44 marked-file-count 45 ---- 46 2 files marked for compaction 47 48 reopen 49 ---- 50 OK 51 52 format-major-version 53 ---- 54 006 55 56 # Ensure the files previously marked for compaction are still marked for 57 # compaction. 58 59 marked-file-count 60 ---- 61 2 files marked for compaction 62 63 disable-automatic-compactions false 64 ---- 65 66 # Ratcheting to 007 should force compaction of any files still marked for 67 # compaction. 68 69 ratchet-format-major-version 007 70 ---- 71 [JOB 100] compacted(rewrite) L1 [000004 000008] (1.6 K) + L1 [] (0 B) -> L1 [000013] (786 B), in 1.0s (2.0s total), output rate 786 B/s 72 73 format-major-version 74 ---- 75 007 76 77 lsm 78 ---- 79 1: 80 000013:[d#0,SET-f#0,SET] 81 82 # Reset to a new LSM. 83 84 define 85 L1 86 b.SET.0:b c.SET.5:c 87 L1 88 m.SET.0:m l.SET.5:l 89 L1 90 x.SET.0:x y.SET.5:y 91 ---- 92 1: 93 000004:[b#0,SET-c#5,SET] points:[b#0,SET-c#5,SET] 94 000005:[l#5,SET-m#0,SET] points:[l#5,SET-m#0,SET] 95 000006:[x#0,SET-y#5,SET] points:[x#0,SET-y#5,SET] 96 97 build ab 98 set a a 99 set b b 100 ---- 101 102 build cd 103 set c c 104 set d d 105 ---- 106 107 build wx 108 set w w 109 set x x 110 ---- 111 112 force-ingest paths=(ab, cd, wx) level=1 113 ---- 114 1: 115 000007:[a#1,SET-b#1,SET] points:[a#1,SET-b#1,SET] 116 000004:[b#0,SET-c#5,SET] points:[b#0,SET-c#5,SET] 117 000008:[c#2,SET-d#2,SET] points:[c#2,SET-d#2,SET] 118 000005:[l#5,SET-m#0,SET] points:[l#5,SET-m#0,SET] 119 000009:[w#3,SET-x#3,SET] points:[w#3,SET-x#3,SET] 120 000006:[x#0,SET-y#5,SET] points:[x#0,SET-y#5,SET] 121 122 format-major-version 123 ---- 124 005 125 126 ratchet-format-major-version 006 127 ---- 128 129 format-major-version 130 ---- 131 006 132 133 marked-file-count 134 ---- 135 5 files marked for compaction 136 137 disable-automatic-compactions false 138 ---- 139 140 ratchet-format-major-version 007 141 ---- 142 [JOB 100] compacted(rewrite) L1 [000007 000004 000008] (2.4 K) + L1 [] (0 B) -> L1 [000011] (794 B), in 1.0s (2.0s total), output rate 794 B/s 143 [JOB 100] compacted(rewrite) L1 [000009 000006] (1.6 K) + L1 [] (0 B) -> L1 [000012] (786 B), in 1.0s (2.0s total), output rate 786 B/s 144 145 lsm 146 ---- 147 1: 148 000011:[a#0,SET-d#0,SET] 149 000005:[l#5,SET-m#0,SET] 150 000012:[w#0,SET-y#0,SET] 151 152 format-major-version 153 ---- 154 007