Debian Codegraph @

test/command/suite/wal_recover/ja/update/chunk/free_1_ginfo.test

raw
1 # _database_close/_database_reopen can't use with HTTP because requests via HTTP are always
2 # processed by workers. Workers never use primary WAL role.
3 #@require-interface stdio
4
5 #@require-feature message_pack
6
7 #$GROONGA_ALLOW_DATABASE_REOPEN=yes
8 #$GRN_ENABLE_REFERENCE_COUNT=no
9 #$GRN_WAL_ROLE=primary
10 #$GRN_JA_N_GARBAGES_IN_A_SEGMENT=100
11
12 #@disable-logging
13 cache_limit --max 0
14 #@enable-logging
15
16 table_create Memos TABLE_HASH_KEY ShortText
17 column_create Memos content COLUMN_SCALAR Text
18
19 io_flush
20 #@copy-path #{db_path}.0000101 #{db_path}.0000101.initial
21
22 #@timeout 300
23
24 # We need grn_ja_n_garbages_in_a_segment(100) + JA_N_GARBAGES_TH(10) + 1 or more
25 # garbage to free garbage segment.
26
27 # Root ginfo: 0
28 # Segment:
29 # 0: einfo
30 # 1: chunk
31
32 #@disable-logging
33 #@generate-series 1 111 Memos '{"_key" => "chunk: 8B <= && < 64KiB: #{i}", "content" => "chunkXXX"}'
34 #@enable-logging
35
36 check --obj Memos.content
37
38 # Root ginfo: 2
39 # Segment:
40 # 0: einfo
41 # 1: chunk
42 # 2: ginfo -> 3
43 # 3: ginfo
44
45 delete Memos --filter true
46
47 check --obj Memos.content
48
49 # Root ginfo: 3
50 # Segment:
51 # 0: einfo
52 # 1: chunk
53 # 3: ginfo
54
55 #@disable-logging
56 #@generate-series 1 110 Memos '{"_key" => "chunk: 8B <= && < 64KiB: #{i}", "content" => "chunkXXX"}'
57 #@enable-logging
58
59 check --obj Memos.content
60
61 select Memos
62
63 #@copy-path #{db_path}.0000101.wal #{db_path}.0000101.wal.keep
64 _database_close
65
66 #@copy-path #{db_path}.0000101 #{db_path}.0000101.keep
67 #@copy-path #{db_path}.0000101.initial #{db_path}.0000101
68 #@copy-path #{db_path}.0000101.wal.keep #{db_path}.0000101.wal
69 _database_reopen
70
71 select Memos
72
73 check --obj Memos.content