iotaledger / iri

IOTA Reference Implementation
Other
1.15k stars 370 forks source link

Database snapshot from Linux leads to unexpected behaviour on Windows #477

Open romansemko opened 6 years ago

romansemko commented 6 years ago

Steps to reproduce on Windows:

  1. Use the latest IRI 1.4.1.6
  2. Download the database snapshot from iota.partners. Extract.
  3. Start IRI with database path pointing to the extracted folder.
  4. IRI logs following error during the start: ERROR com.iota.iri.Milestone - Error initializing snapshots. Skipping. org.rocksdb.RocksDBException: Snappy not supported or corrupted Snappy compressed block contents at org.rocksdb.RocksDB.get(Native Method) ~[iri-1.4.1.6-bolero.jar:na] at org.rocksdb.RocksDB.get(RocksDB.java:810) ~[iri-1.4.1.6-bolero.jar:na] at com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider.get(RocksDBPersistenceProvider.java:193) ~[iri-1.4.1.6-bolero.jar:na] at com.iota.iri.storage.Tangle.load(Tangle.java:40) ~[iri-1.4.1.6-bolero.jar:na] at com.iota.iri.controllers.StateDiffViewModel.load(StateDiffViewModel.java:18) ~[iri-1.4.1.6-bolero.jar:na] at com.iota.iri.LedgerValidator.buildSnapshot(LedgerValidator.java:229) ~[iri-1.4.1.6-bolero.jar:na] at com.iota.iri.LedgerValidator.init(LedgerValidator.java:201) ~[iri-1.4.1.6-bolero.jar:na] at com.iota.iri.Milestone.lambda$init$1(Milestone.java:138) ~[iri-1.4.1.6-bolero.jar:na] at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_151] 01/09 01:24:33.047 [main] INFO com.iota.iri.IRI - IOTA Node initialised correctly.

IRI continues normally, nonetheless. However, it never gets synced. All values apart of the all transactions stay at zero. Does not matter if one uses Nelson or static neighbours.

zoran commented 6 years ago

that's strange, because the DB is a full copy and not a snapshot.

romansemko commented 6 years ago

I suspect that the rockdb dll for windows is linked without snappy, whereas on mac/linux it's with snappy. Similar to this issue: https://github.com/facebook/rocksdb/issues/1887

Would be nice to have them identical. And still not sure why it affects IRI not being synchronised.

JasonCoombs commented 6 years ago

seeing the same error here.

huggre commented 6 years ago

Same issue with my Windows node, switched to Ubuntu and problem solved.

alon-e commented 6 years ago

This is a known issue in RocksDB - the only way to resolve this is to actively not compress the DB. CompressionTypes in the past, the only compression type supported on all systems (Linux, Windows, Mac) was No Compression - tested by reading available Options in IDE on each system.

this could have changed since, if so, then it's worth reconsidering a different, cross-platform compression scheme - help wanted to explore this.

brunoamancio commented 6 years ago

Same issue when developing on windows.