iri icon indicating copy to clipboard operation
iri copied to clipboard

spent-addresses-db folder has no sst files

Open ed2k opened this issue 7 years ago • 11 comments

Bug description

unable restart IRI after it is synced. (1.5.6 has no such problem)

IRI version

latest dev 1.6.1, 1.6.0

Hardware Spec

ubuntu-1804, digital ocean vps or home dell xps

Steps To Reproduce

  1. bring up private testnet, with IOTA transactions
  2. wait until IRI synced,
  3. stop then start IRI

Expected behaviour

IRI able to start and continue to run

Actual behaviour

IRI stopped,

Errors

02/25 02:57:37.972 [main] INFO com.iota.iri.IRI$IRILauncher - Welcome to IRI Testnet 1.6.1-RELEASE Exception in thread "main" com.iota.iri.service.spentaddresses.SpentAddressesException: spent-addresses-db folder has no sst files at com.iota.iri.service.snapshot.impl.SnapshotProviderImpl.assertSpentAddressesDbExist(SnapshotProviderImpl.java:246) at com.iota.iri.service.snapshot.impl.SnapshotProviderImpl.loadLocalSnapshot(SnapshotProviderImpl.java:212) at com.iota.iri.service.snapshot.impl.SnapshotProviderImpl.loadSnapshots(SnapshotProviderImpl.java:187) at com.iota.iri.service.snapshot.impl.SnapshotProviderImpl.init(SnapshotProviderImpl.java:102) at com.iota.iri.Iota.injectDependencies(Iota.java:202) at com.iota.iri.Iota.(Iota.java:153) at com.iota.iri.IRI$IRILauncher.main(IRI.java:119) at com.iota.iri.IRI.main(IRI.java:60)

ed2k avatar Feb 25 '19 03:02 ed2k

This is a loophole in the protection mechanism against loading local snapshots with not spent-addressses db

GalRogozinski avatar Feb 25 '19 12:02 GalRogozinski

I'm hitting this issue as well. There seem to be a period of time which local snapshot files are present on disk, but no spent-address-db SST files are available on disk.

find . -name "snapshot"

./testnet.snapshot.state.bkp ./testnet.snapshot.state ./testnet.snapshot.meta ./testnet.snapshot.meta.bkp

find spent-addresses-db

spent-addresses-db spent-addresses-db/OPTIONS-000006 spent-addresses-db/IDENTITY spent-addresses-db/OPTIONS-000008 spent-addresses-db/MANIFEST-000004 spent-addresses-db/000003.log spent-addresses-db/CURRENT spent-addresses-db/LOCK

geminoz avatar Feb 26 '19 00:02 geminoz

It there a way to fix this issue?

alexkvak avatar Feb 26 '19 06:02 alexkvak

A quick workaround that may work is to delete the snapshot files (state and metadata)

GalRogozinski avatar Feb 26 '19 08:02 GalRogozinski

If I use docker it's not so simple. I disabled snapshots and waiting a couple hours for resyncing... Why IRI fails on every Exception?

alexkvak avatar Feb 26 '19 08:02 alexkvak

This is a feature to make sure you don't run IRI without the spent-addresses-db

GalRogozinski avatar Feb 26 '19 08:02 GalRogozinski

I know that @geminoz encountered this bug on devnet. The other people who are experiencing this issue are on mainnet?

Currently on mainnet we are serializing the previousSpentFromEpoch file to the db on startup so no sst files should go missing.

GalRogozinski avatar Feb 26 '19 10:02 GalRogozinski

The problem on devnet is that there may be lots of spam without actual spents. So after a snapshot the spent-addresses-db can still be empty

GalRogozinski avatar Feb 26 '19 14:02 GalRogozinski

We attempt to check whether we have a good spent-addresses-db file when starting a db from Local Snapshot files. So we check whether there are any serialized sst files. However, when we do testing with a private tangle where we may have many milestones and less spam transactions, we may end up with no sst files since RocksDB didn't serialize them and the data is kept in the WAL (Write ahead Log).

GalRogozinski avatar May 02 '19 06:05 GalRogozinski

would transfer 1 iota trigger the creation of spent-addresses-db/.sst if no spending, can I just create an empty .sst file (as a workaround).

ed2k avatar May 08 '19 03:05 ed2k

  1. We need to read from the DB and not check sst files
  2. For testnet/private network maybe we should just ignore this rule all together

GalRogozinski avatar Jun 05 '19 20:06 GalRogozinski