Skip to content

Commit eed4d5d

Browse files
committed
Fix test_fsm for COPY that no longer force-checkpoints under auto_checkpoint=false
Since ladybug commit 4ca1d6f5d ("Fix #755: COPY respects auto_checkpoint setting"), COPY with auto_checkpoint=false leaves the data in the WAL instead of checkpointing. The FSM tests captured used page ranges right after COPY, at which point storage_info() reported in-memory chunks with start_page_idx = INVALID (nothing was on disk yet), so after drop + checkpoint there was nothing in the FSM to compare against and all reclaim assertions failed. Fix: checkpoint explicitly after COPY in the fixtures (and after the re-copy in test_fsm_reclaim_node_table_recopy) so the tests measure real on-disk page indices, preserving the tests' intent of verifying FSM reclaim of persisted pages.
1 parent 63904dd commit eed4d5d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎test/test_fsm.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ def fsm_node_table_setup(tmp_path: Path):
100100
conn.execute(
101101
f"COPY person FROM ['{LBUG_ROOT}/dataset/tinysnb/vPerson.csv', '{LBUG_ROOT}/dataset/tinysnb/vPerson2.csv'](ignore_errors=true, header=false)"
102102
)
103+
# COPY no longer force-checkpoints when auto_checkpoint=false (fix for #755).
104+
# Checkpoint explicitly so the data pages are on disk and storage_info()
105+
# reports real page indices for the reclaim assertions below.
106+
conn.execute("checkpoint")
103107
return db, conn
104108

105109

@@ -112,6 +116,7 @@ def fsm_rel_table_setup(fsm_node_table_setup):
112116
conn.execute(
113117
f"COPY knows FROM ['{LBUG_ROOT}/dataset/tinysnb/eKnows.csv', '{LBUG_ROOT}/dataset/tinysnb/eKnows_2.csv']"
114118
)
119+
conn.execute("checkpoint")
115120
return fsm_node_table_setup
116121

117122

@@ -138,6 +143,7 @@ def fsm_rel_group_setup(tmp_path: Path):
138143
conn.execute(
139144
f'COPY likes FROM "{LBUG_ROOT}/dataset/rel-group/edge.csv" (FROM="personB", TO="personA");'
140145
)
146+
conn.execute("checkpoint")
141147
return db, conn
142148

143149

@@ -193,6 +199,7 @@ def test_fsm_reclaim_node_table_recopy(fsm_node_table_setup) -> None:
193199
conn.execute(
194200
f"COPY person FROM ['{LBUG_ROOT}/dataset/tinysnb/vPerson.csv', '{LBUG_ROOT}/dataset/tinysnb/vPerson2.csv'](ignore_errors=true, header=false)"
195201
)
202+
conn.execute("checkpoint")
196203
new_num_pages = get_total_used_pages(conn)
197204
assert prev_num_pages == new_num_pages
198205

0 commit comments

Comments
 (0)