| 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 |
|
| 11 |
#@disable-logging |
| 12 |
cache_limit --max 0 |
| 13 |
#@enable-logging |
| 14 |
|
| 15 |
table_create Memos TABLE_HASH_KEY ShortText |
| 16 |
column_create Memos content COLUMN_SCALAR Text |
| 17 |
|
| 18 |
io_flush |
| 19 |
#@copy-path #{db_path}.0000101 #{db_path}.0000101.initial |
| 20 |
|
| 21 |
#@timeout 300 |
| 22 |
#@disable-logging |
| 23 |
# We need 13 or more loads to use garbage chunk. |
| 24 |
# Because we need JA_N_GARBAGES_TH(10) + 1 garbages. |
| 25 |
# 1 (new record) + 11 (updates) + 1 (use garbage chunk). |
| 26 |
#@generate-series 1 13 Memos '{"_key" => "chunk: 8B <= && < 64KiB", "content" => "chunkXXXX" + (i.even? ? "-even" : "-odd")}' |
| 27 |
#@enable-logging |
| 28 |
|
| 29 |
check --obj Memos.content |
| 30 |
|
| 31 |
select Memos |
| 32 |
|
| 33 |
#@copy-path #{db_path}.0000101.wal #{db_path}.0000101.wal.keep |
| 34 |
_database_close |
| 35 |
|
| 36 |
#@copy-path #{db_path}.0000101.initial #{db_path}.0000101 |
| 37 |
#@copy-path #{db_path}.0000101.wal.keep #{db_path}.0000101.wal |
| 38 |
_database_reopen |
| 39 |
|
| 40 |
select Memos |
| 41 |
|
| 42 |
check --obj Memos.content |