Open YuXiaoCoder opened 1 year ago
Your initial command makes it seem like your node is already pruned, what's the size of your existing blockchain file?
Is /mnt/
in your data-dir a network drive?
@selsta Yes, I have prune before, and now the file size is 139G, I want to prune again, it is a local disk, not a network device
Is this repeatable ? Looking at what can cause this error, it's not obvious what might be wrong. In any case, a pruned DB should be about 60 GB, so if a pruned DB is at least 89 GB, something is already wrong somewhere. If you can repeat it, then it may be worth trying with:
diff --git a/src/blockchain_utilities/blockchain_prune.cpp b/src/blockchain_utilities/blockchain_prune.cpp
index a78d7ada9..2afc7c5b4 100644
--- a/src/blockchain_utilities/blockchain_prune.cpp
+++ b/src/blockchain_utilities/blockchain_prune.cpp
@@ -665,7 +665,7 @@ int main(int argc, char* argv[])
copy_table(env0, env1, "properties", 0, 0, BlockchainLMDB::compare_string);
if (already_pruned)
{
- copy_table(env0, env1, "txs_prunable", MDB_INTEGERKEY, 0, BlockchainLMDB::compare_uint64);
+ copy_table(env0, env1, "txs_prunable", MDB_INTEGERKEY, MDB_APPEND, BlockchainLMDB::compare_uint64);
copy_table(env0, env1, "txs_prunable_tip", MDB_INTEGERKEY | MDB_DUPSORT | MDB_DUPFIXED, 0, BlockchainLMDB::compare_uint64);
}
else
and see if that fixes it. This flag is used by monerod, and theoretically it should only just make it faster (so good anyway), but it also happens to bypass some of the code which could return that error, so would be a good way to rule out some of the possible causes.
@moneromooo-monero I will try to prune again, this process may take a few hours, I will sync to here when I have the results
I still cleaned the lmdb-pruned/ directory and re-executed the pruning command, still got the same error
2023-04-21 04:01:30.382 I LMDB Mapsize increased. Old: 84127MiB, New: 84639MiB
2023-04-21 04:02:30.487 I LMDB Mapsize increased. Old: 84639MiB, New: 85153MiB
2023-04-21 04:03:43.913 I LMDB Mapsize increased. Old: 85153MiB, New: 85667MiB
2023-04-21 04:04:43.113 I LMDB Mapsize increased. Old: 85667MiB, New: 86181MiB
2023-04-21 04:05:36.964 I LMDB Mapsize increased. Old: 86181MiB, New: 86693MiB
2023-04-21 04:06:38.401 I LMDB Mapsize increased. Old: 86693MiB, New: 87208MiB
2023-04-21 04:07:38.753 I LMDB Mapsize increased. Old: 87208MiB, New: 87720MiB
2023-04-21 04:08:44.350 I LMDB Mapsize increased. Old: 87720MiB, New: 88234MiB
2023-04-21 04:09:37.169 I LMDB Mapsize increased. Old: 88234MiB, New: 88748MiB
2023-04-21 04:10:40.259 I LMDB Mapsize increased. Old: 88748MiB, New: 89262MiB
2023-04-21 04:11:15.703 E Exception at [Pruning error], what=Failed to write txs_prunable record: MDB_BAD_VALSIZE: Unsupported size of key/DB name/data, or wrong DUPFIXED size
Could you put up the source db up for download somewhere if possible ?
AFAIK when an existing db has been pruned the file size stays the same i.e if it is 140GB it stays 140GB only inside the db is pruned. I solved it by doing the same setup on another PC and added to monerod --prune-blockchain --sync-pruned-blocks. Tried pruning the db last year and it didn't shrink the file size. As I had a spare PC made an extra monero node with the extra --prune-blockchain and --sync-pruned-blocks on the command line and let it rebuild the db file, took abt 12 hours for the db to build, copied the file over to my main node and that worked.
At the moment my db file now is abt 61GB.
There is clearly something wrong with monero-blockchain-prune tool. My scenario was similar to the above with identical effect (as far as I understood my predecessor).
1) Originally I synced the full blockchain - the size was 175G 2) Then I have discovered --prune-blockchain switch for monerod - run monerod with it for couple of days and database size stayed the same 3) Then I have realized that using the --prune-blockchain in monerod will actually not make the file smaller - so fact that it stayed the same in point 2 was as expected 4) So in order to actually I have decided to run to run monero-blockchain-prune tool. At first is has failed with message that database is already pruned (indeed it was) and suggested to run with copy-pruned-database option, so I did so 5) Now that process monero-blockchain-prune with --copy-pruned-database is still running (since two weeks), and the new file is growing - it is already reached 126G (which is much more than I would expect from database after pruned blocks have been removed (I would assume the --copy-pruned-database should do that). Based on last entry in the log: LMDB Mapsize increased. Old: 129383MiB, New; 129895MiB, it looks data is being just copied as it is (but then why this takes 2 weeks?)
I have started separate process on different machine where monerod was started from the beginning with --prune-database switch and there (I'm still on 90% of blockchain synchronization), my database if only 52G - clearly much less than also not yet completed effect of monero-blockchain-prune.......
I will let both processes to complete and will share the final result, but all signs show that monero-blockchain-prune simply does not work (at least not in the way I would expect).
I use the following command to run the node, the node version is 0.18.2.2
I want to further reduce the disk space occupied by monero-blockchain-prune
Got the following log error