dqlite icon indicating copy to clipboard operation
dqlite copied to clipboard

Does handle_prepare need FAIL_IF_CHECKPOINTING?

Open cole-miller opened this issue 2 years ago • 2 comments

@MathieuBordere and I were looking at gateway.c as part of working on something else, and he noticed that handle_exec, handle_query, handle_exec_sql, and handle_query_sql all have an initial check that throws an error if an SQLite checkpoint is in progress, while handle_prepare doesn't have this check. We're not sure whether it should be added or not -- this issue tracks figuring that out.

cole-miller avatar Sep 08 '22 16:09 cole-miller

Another question (for @freeekanayaka) is whether we still need FAIL_IF_CHECKPOINTING at all.

edit (MathieuBordere): The question is, could we rely on the SQLite API's return values indicating the db is busy instead of implementing our own checks? We take all locks in the checkpoint anyway.

cole-miller avatar Sep 08 '22 16:09 cole-miller

Another question (for @freeekanayaka) is whether we still need FAIL_IF_CHECKPOINTING at all.

edit (MathieuBordere): The question is, could we rely on the SQLite API's return values indicating the db is busy instead of implementing our own checks? We take all locks in the checkpoint anyway.

I'm not entirely sure about this. It might be that after the checkpoint changes implemented by @MathieuBordere a while ago, this is unnecessary, but needs careful investigation.

freeekanayaka avatar Sep 09 '22 08:09 freeekanayaka