Bug: SN gross space limit overstep

We can try to fix the issue with the local database, but I’m not sure will it help or not.
We currently do not have any auto fixing tools, since the database corruption percentage is low.

  1. Stop the storagenode
  2. Create a backup of piece_spaced_used.db database
  3. Remove the piece_spaced_used.db database
  4. Execute either with a local sqlite3 (make sure that version is not older than v3.25.2), or with a docker version (see https://support.storj.io/hc/en-us/articles/360029309111 for reference), specify correct path to piece_spaced_used.db:
sqlite3 piece_spaced_used.db
  1. When you see a sqlite> prompt execute this script:
CREATE TABLE versions (version int, commited_at text);
CREATE TABLE piece_space_used (
                                                total INTEGER NOT NULL DEFAULT 0,
                                                content_size INTEGER NOT NULL,
                                                satellite_id BLOB
                                        );
CREATE UNIQUE INDEX idx_piece_space_used_satellite_id ON piece_space_used(satellite_id);
insert into versions values(29, datetime('now', 'utc'));
insert into versions values(30, datetime('now', 'utc'));
insert into versions values(31, datetime('now', 'utc'));
.exit
  1. Start the storagenode
  2. Let it work with the disk (it could take a few hours for full tree traversal);
  3. Check usage on dashboards