on deleting it gives me error no table main.sertificate, as last column is forein key to sertificate id
In which case?
Waiting? You do not do nothing.
Remove only fresh records?
Perhaps it’s much better just start with erasing a whole database, since it belongs to a different identity.
We do not have a way to determine the owning of orders on the storagenode’s side. So deleting only fresh records will delete valid unsettled orders too.
Also, I guess but the data could be from a different identity too. In such case I would like to suggest to check your audit score for sure.
To delete a whole orders.db
:
- Stop the storagenode
- Rename
orders.db
toorders.db.old
- Execute with either a local sqlite3 or a docker version (replace the path to actual):
sqlite3 /path/to/orders.db
When you see the sqlite>
prompt:
CREATE TABLE unsent_order (
satellite_id BLOB NOT NULL,
serial_number BLOB NOT NULL,
order_limit_serialized BLOB NOT NULL, -- serialized pb.OrderLimit
order_serialized BLOB NOT NULL, -- serialized pb.Order
order_limit_expiration TIMESTAMP NOT NULL, -- when is the deadline for sending it
uplink_cert_id INTEGER NOT NULL,
FOREIGN KEY(uplink_cert_id) REFERENCES certificate(cert_id)
);
CREATE TABLE order_archive_ (
satellite_id BLOB NOT NULL,
serial_number BLOB NOT NULL,
order_limit_serialized BLOB NOT NULL,
order_serialized BLOB NOT NULL,
uplink_cert_id INTEGER NOT NULL,
status INTEGER NOT NULL,
archived_at TIMESTAMP NOT NULL,
FOREIGN KEY(uplink_cert_id) REFERENCES certificate(cert_id)
);
CREATE UNIQUE INDEX idx_orders ON unsent_order(satellite_id, serial_number);
CREATE TABLE versions (version int, commited_at text);
.exit
- Start the storagenode
- Check your logs
Thank you.
Now looks work fine, dont consume 4GB ram any more. no error on first order sumbision also.
Была такая же проблема, одна нода под 4ГБ памяти съедала, файл orders.db 2ГБ был. Очистка помогла. Нода в докере.