Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

WAL files left after export of protected areas #180

Closed
ronoaldo opened this issue Nov 28, 2023 · 0 comments
Closed

WAL files left after export of protected areas #180

ronoaldo opened this issue Nov 28, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ronoaldo
Copy link
Contributor

After executing an export of protected areas, the resulting folder was left with some -wal and -shm files left.

According to https://www.sqlite.org/walformat.html:

"(...) if the last client did not call sqlite3_close() before it shut down, or if the last client to disconnect was a read-only client, then the final cleanup operation does not occur and the shm and wal files may still exist on disk even when the database is not in use."

My understanding is that there should be no files left, and that they may indicate an incomplete export if the user forgets to open/close the db again to apply the remaining transactions from the journal and just uses the .db file.

A workaround is to run sqlite3 map.sqlite "select count(*) from blocks" right after the export and this will then flush all transactions and clean the files.

@BuckarooBanzay BuckarooBanzay added the bug Something isn't working label Nov 28, 2023
@ronoaldo ronoaldo self-assigned this Nov 30, 2023
ronoaldo added a commit to ronoaldo/mapcleaner that referenced this issue Nov 30, 2023
Gracefully flushes the remaining transactions
for Sqlite.
Requires new release of minetest-go/mtdb.
Fixes minetest-go#180
BuckarooBanzay pushed a commit that referenced this issue Dec 10, 2023
* fix: misplaced log could cause panic/nil pointer.
Regression from #181

* fix: call BlockRepository.Close() when exporting.
Gracefully flushes the remaining transactions
for Sqlite.
Requires new release of minetest-go/mtdb.
Fixes #180

* fix: enable CGO for sqlite3.

* deps: update to minetest-go/mtdb@v1.1.45

* feat:  new option to export all protected nodes
Fixes #184

* wip: testing mtdb v1.1.45-rc1

Refs: #184 #185

* fix: export surounding chunks of protected nodes.
Avoid losing data when protected nodes
are at the mapblock/mapchunk edges.

* fix: wrong nested loop.
Nasty loops!

* deps: updated dependencies.

* test: emerging more nodes to test exported region.

Accounting for two neighbor chunks and the surrounding
being exported when --export-all is provided.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants