Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

VoxelStreamSQLite is missing chunks when loads #597

Open
matthewhilton opened this issue Feb 4, 2024 · 1 comment
Open

VoxelStreamSQLite is missing chunks when loads #597

matthewhilton opened this issue Feb 4, 2024 · 1 comment
Labels
Reproduction needed Cannot be fixed until a minimal test project or precise steps that reproduce the issue are provided

Comments

@matthewhilton
Copy link

Describe the bug
When loading a stream from VoxelStreamSQLite, there are missing chunks in the save:

Possibly related to #596

To Reproduce
Use this example project: VoxelSaveLoadTestSQLite.zip

  1. Change the VoxelStreamSQLite directory to somewhere on your computer
  2. Start the game, and press 'E' this will generate a big cube
  3. Press 'R' and check the console output, it will save the SQLite db
  4. Reload the game
  5. The SQLite DB is loaded, but there are missing chunks

Expected behavior
There shouldn't be missing chunks in the loaded edits.

Screenshots
The saved edit:
image

The loaded edit from the SQLite DB:
image

Environment

@Zylann
Copy link
Owner

Zylann commented Feb 4, 2024

I changed the path to be just save3.sqlite so it saves next to the game.
I did a first test and the cube loaded properly.
I tested several more times, still could not reproduce.

As mentionned in #596 (comment), my only suspicions are that saving didnt finish when you closed the game, and/or you closed the game by killing it instead of using regular closing.
In addition, the SQLite stream uses a cache to batch saves because they can be quite slow if done individually. That cache is normally flushed when full or when the resource is destroyed (when the game closes normally or nothing else references it), but won't have the opportunity to get flushed if you kill the game, even if all saving tasks are done. So indeed, if I use the Stop button of the editor (which kills the game with no chance of cleanup), chunks go missing, which is currently expected.
(cache flushing has been patched in 75f9241)

Note: in this project, you have run_stream_in_editor turned on. That means if the scene is open, the save file will be held open and can't be deleted until the scene is closed. There can also be writing conflicts if both the editor and the game try to write into it. That didn't seem to prevent the game from loading or saving, but in order to reproduce I had to close the scene file so I could delete the save.

issue597_cant_repro2.mp4

@Zylann Zylann added the Needs more info Couldn't repro / more info needed label Feb 4, 2024
@Zylann Zylann added Reproduction needed Cannot be fixed until a minimal test project or precise steps that reproduce the issue are provided and removed Needs more info Couldn't repro / more info needed labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reproduction needed Cannot be fixed until a minimal test project or precise steps that reproduce the issue are provided
Projects
None yet
Development

No branches or pull requests

2 participants