- Joined
- Feb 15, 2016
- Messages
- 239
- Reaction score
- 58
Request/Goal:
Enable admins/operators to programmatically and forcefully save an entity's blockdata to disk.
Currently:
The server's entity/sector unload routine does not re-write an entity's blockdata to disk if entity's "touched" attribute is false. The only known way to currently set an entity's touched attribute to true, is in-game, by making actual changes to an entity's blockdata (e.g. adding/removing blocks, or activating/deactivating logic, lights, AI etc).
Result of proposed:
While evaluating an entity for removal from memory, the server would remove existing blockdata stored on disk, and then write a new/fresh datafile using blockdata from memory.
Suggested Method:
The tool "touch", is common throughout the Linux/Unix world; it's purpose is primarily to adjust a file or folder's access or modification date without requiring a file be opened, saved, and closed.
The equivalent here, would be implementing a way for the game engine to know if a file needs to be re-written, regardless of current in-memory blockdata/metadata attributes, without requiring that a player manually make a blockdata level change to the entity.
A way to support this function programmatically, new command:
Rationale:
Enable admins/operators to programmatically and forcefully save an entity's blockdata to disk.
Currently:
The server's entity/sector unload routine does not re-write an entity's blockdata to disk if entity's "touched" attribute is false. The only known way to currently set an entity's touched attribute to true, is in-game, by making actual changes to an entity's blockdata (e.g. adding/removing blocks, or activating/deactivating logic, lights, AI etc).
Result of proposed:
While evaluating an entity for removal from memory, the server would remove existing blockdata stored on disk, and then write a new/fresh datafile using blockdata from memory.
Suggested Method:
The tool "touch", is common throughout the Linux/Unix world; it's purpose is primarily to adjust a file or folder's access or modification date without requiring a file be opened, saved, and closed.
The equivalent here, would be implementing a way for the game engine to know if a file needs to be re-written, regardless of current in-memory blockdata/metadata attributes, without requiring that a player manually make a blockdata level change to the entity.
A way to support this function programmatically, new command:
/touch_uid [UID of entity to set "touched=true"]
Rationale:
- StarMade makes extensive use of sparse files, however this is still a relatively new concept for both experienced, and inexperienced, developers, engineers, and users.
- Sparse files support is not ubiquitous nor usually automatic. Therefore it's inevitable for players and/or admins to transfer datafiles using tools unable to support sparse files (e.g. FTP, SFTP, SCP, PkZIP, etc). The result of this can balloon datafiles to many times their original "sparse" size.
- For a good illustration of this, compare output from the following two commands on any StarMade folder structure:
-
Code:
du -d0 -h --apparent-size StarMade/server-database/ du -d0 -h StarMade/server-database/
- Some of StarMade's own functions lack sparse file support, for instance when backing a server up on Windows (e.g. PkZip lacks sparse support). This means that if a windows server operator depended upon SM's backups to restore a server database, they're risking some profound disk space consumption issues upon extraction of a .zip backup.
- An extreme example of removing sparseness from an entire server's database:
- With sparseness intact, this server requires only ~26GB of disk space:
Code:
du -d0 -h StarMade/server-database/ 26G StarMade/server-database/
- With no sparseness intact, this server would require ~189GB of disk space:
Code:
du -d0 -h --apparent-size StarMade/server-database/ 189G StarMade/server-database/
- With sparseness intact, this server requires only ~26GB of disk space:
- As a "workaround" for the very real scenario of accidentally removing a file's sparseness, it would be very useful if players could load entities (e.g. /sector_load_range), and then force the server to re-write each entity's data into a new datafile on disk.