{"action":"created","issue":{"url":"https://api.github.com/repos/iotaledger/iri/issues/703","repository_url":"https://api.github.com/repos/iotaledger/iri","labels_url":"https://api.github.com/repos/iotaledger/iri/issues/703/labels{/name}","comments_url":"https://api.github.com/repos/iotaledger/iri/issues/703/comments","events_url":"https://api.github.com/repos/iotaledger/iri/issues/703/events","html_url":"https://github.com/iotaledger/iri/issues/703","id":316567316,"number":703,"title":"IRI-126 ⁃ IRI Shutdown Doesn't Flush Memory DB to Disk","user":{"login":"iotasyncbot","id":38458862,"avatar_url":"https://avatars3.githubusercontent.com/u/38458862?v=4","gravatar_id":"","url":"https://api.github.com/users/iotasyncbot","html_url":"https://github.com/iotasyncbot","followers_url":"https://api.github.com/users/iotasyncbot/followers","following_url":"https://api.github.com/users/iotasyncbot/following{/other_user}","gists_url":"https://api.github.com/users/iotasyncbot/gists{/gist_id}","starred_url":"https://api.github.com/users/iotasyncbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iotasyncbot/subscriptions","organizations_url":"https://api.github.com/users/iotasyncbot/orgs","repos_url":"https://api.github.com/users/iotasyncbot/repos","events_url":"https://api.github.com/users/iotasyncbot/events{/privacy}","received_events_url":"https://api.github.com/users/iotasyncbot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-22T10:29:32Z","updated_at":"2018-04-22T10:29:36Z","closed_at":null,"author_association":"NONE","body":"Doing a shutdown of the IRI and subsequent start does not resume from latest transaction history.\n\nIssuing a `systemctl stop iota` which sends SIGTERM to the IRI process and subsequent `systemctl start iota` results in the following log messages:\n\n```\nDec 26 17:00:31 iota systemd[1]: Stopping IOTA (IRI) full node...\nDec 26 17:00:31 iota IRI[737]: 12/26 17:00:31.188 [Shutdown Hook] INFO  com.iota.iri.IRI - Shutting down IOTA node, please hold tight...\nDec 26 17:00:32 iota IRI[737]: 12/26 17:00:32.151 [pool-2-thread-1] INFO  com.iota.iri.network.Node - Shutting down Broadcaster Thread\nDec 26 17:00:32 iota IRI[737]: 12/26 17:00:32.151 [pool-2-thread-4] INFO  com.iota.iri.network.Node - Shutting down Process Received Data Thread\nDec 26 17:00:32 iota IRI[737]: 12/26 17:00:32.151 [pool-2-thread-5] INFO  com.iota.iri.network.Node - Shutting down Reply To Request Thread\nDec 26 17:00:33 iota IRI[737]: 12/26 17:00:33.075 [pool-2-thread-3] INFO  com.iota.iri.network.Node - Shutting down Neighbor DNS Refresher Thread\nDec 26 17:00:36 iota IRI[737]: 12/26 17:00:36.870 [pool-2-thread-2] INFO  com.iota.iri.network.Node - Shutting down Requester Thread\nDec 26 17:00:36 iota IRI[737]: 12/26 17:00:36.877 [UDP receiving thread] INFO  com.iota.iri.network.UDPReceiver - Shutting down spawning Receiver Thread\nDec 26 17:00:49 iota IRI[737]: 12/26 17:00:49.211 [Shutdown Hook] INFO  com.iota.iri.storage.Tangle - Shutting down Tangle Persistence Providers...\nDec 26 17:00:50 iota systemd[1]: iota.service: Main process exited, code=exited, status=143/n/a\nDec 26 17:00:50 iota systemd[1]: Stopped IOTA (IRI) full node.\nDec 26 17:00:50 iota systemd[1]: iota.service: Unit entered failed state.\nDec 26 17:00:50 iota systemd[1]: iota.service: Failed with result 'exit-code'.\nDec 26 17:00:50 iota systemd[1]: Started IOTA (IRI) full node.\n```\n\nAfter the stop/start operations the service does not start from the latest milestone before the stop but some other unknown previous point. In this example the service was at 7599422 transactions before stop and started at 5979754. Not positive but this seems to be the point of the initial DB snapshot installed on the system.\n\nThis results in 1-2hr of, what should be unnecessary, syncing to catch up to the latest milestone index.\n\n"},"comment":{"url":"https://api.github.com/repos/iotaledger/iri/issues/comments/383370981","html_url":"https://github.com/iotaledger/iri/issues/703#issuecomment-383370981","issue_url":"https://api.github.com/repos/iotaledger/iri/issues/703","id":383370981,"user":{"login":"iotasyncbot","id":38458862,"avatar_url":"https://avatars3.githubusercontent.com/u/38458862?v=4","gravatar_id":"","url":"https://api.github.com/users/iotasyncbot","html_url":"https://github.com/iotasyncbot","followers_url":"https://api.github.com/users/iotasyncbot/followers","following_url":"https://api.github.com/users/iotasyncbot/following{/other_user}","gists_url":"https://api.github.com/users/iotasyncbot/gists{/gist_id}","starred_url":"https://api.github.com/users/iotasyncbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iotasyncbot/subscriptions","organizations_url":"https://api.github.com/users/iotasyncbot/orgs","repos_url":"https://api.github.com/users/iotasyncbot/repos","events_url":"https://api.github.com/users/iotasyncbot/events{/privacy}","received_events_url":"https://api.github.com/users/iotasyncbot/received_events","type":"User","site_admin":false},"created_at":"2018-04-22T10:29:36Z","updated_at":"2018-04-22T10:29:36Z","author_association":"NONE","body":"➤ Alon Elmaliah commented:\n\n>I did a service stop passing SIGINT at 6976339 transactions and after an immediate start I came up with 7246187.\n\nthe reason why the transaction count changes dramatically when restarting is due to the way tx count is fetched: [RocksDBPersistenceProvider.java#L216](https://github.com/iotaledger/iri/blob/dev/src/main/java/com/iota/iri/storage/rocksDB/RocksDBPersistenceProvider.java#L216)\n\nthis is an estimate on the number of keys, and \"this estimation can be far off ...\",\nyou may also see this number decrease in the first few minutes after restart - as the estimate becomes more accurate.\n\nfor more info see: https://github.com/facebook/rocksdb/wiki/RocksDB-FAQ\n\n>Even with the higher number of transactions after restart it has been 10 minutes with no milestone message.\n\nthis is due to the ledgerValidatorInitialized taking time to scan and build the latest milestone state [Milestone.java#L82](https://github.com/iotaledger/iri/blob/dev/src/main/java/com/iota/iri/Milestone.java#L82)\n\n>This results in 1-2hr of, what should be unnecessary, syncing to catch up to the latest milestone index.\n\nthis process above (ledgerValidatorInitialized) shouldn't take 1-2hrs, or does that take 10 mins?\ncan you share your system's specs? SSD/HDD?\n"}}
{"actor":{"display_login":"iotasyncbot"}}