The International Simutrans Forum

 

Author Topic: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)  (Read 78880 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #280 on: August 28, 2018, 12:54:48 PM »
I am away this week without access even to my secondary desktop, so I am afraid that I cannot fix this at present - please let me know whether it resolves itself to-morrow.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #281 on: August 29, 2018, 05:20:00 AM »
Seems to have resolved itself with the nightly deploy.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #282 on: August 31, 2018, 08:08:15 AM »
Server offline again... Again seems around time of reboot, or slightly earlier.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #283 on: September 02, 2018, 10:15:34 AM »
My apologies for the difficulty: the saved game appears to have become corrupted. I have now restored from the backup.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #284 on: September 02, 2018, 02:53:33 PM »
The passwords are gone in the backup save. Apparently there has been some progress since the reboot. I would be fine with rebooting with a correct save, would anyone oppose that?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #285 on: September 02, 2018, 02:58:21 PM »
Can you elaborate on what you mean by "rebooting with a correct save"?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #286 on: September 02, 2018, 03:08:12 PM »
I meant to restart the server with a backup where the passwords have been kept. It has happened before that the server got stuck with a corrupt save and was restored with a backup without passwords.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #287 on: September 02, 2018, 03:12:11 PM »
I am not sure that the server has any left with passwords now and it would take a very long time laboriously to check each one; would it not be easier for players simply to restore their passwords?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #288 on: September 02, 2018, 03:25:37 PM »
You have loaded the wrong save. The one restored to is ancient, losing many hours of peoples work.

Bellow is a link to the most recent save game before the server crashed. Or at least it was the most recent one I have. It is not corrupt.
https://www.dropbox.com/s/o8dxwltzod25jm2/Extended%20Server%20Game%2030082018.sve?dl=0

This save is considerably in the future compared with the current one. I completely redid the transport for several islands including setting up complex bus routes.
« Last Edit: September 02, 2018, 04:01:49 PM by DrSuperGood »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #289 on: September 02, 2018, 04:08:52 PM »
I had not restored "the wrong" saved game - I had restored the latest apparently uncorrupted game available in my set of backups. I note that there are people online now - I will have to check with them before now resetting whatever they are doing now and re-loading this game.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #290 on: September 02, 2018, 04:17:32 PM »
Quote
I had not restored "the wrong" saved game - I had restored the latest apparently uncorrupted game available in my set of backups.
So the server does not keep a copy of the most recent made multiplayer saves like the clients do? Or was it that all of them were corrupted?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #291 on: September 02, 2018, 04:20:48 PM »
The server keeps a copy of the single latest save. That was corrupted. The server has also been configured to have a rotating backup of 6 prior versions. The latest in time of these was also corrupted, so I restored the second latest in time, being the most recent apparently uncorrupted saved game available.

I am now having trouble connecting to the server to try to speak to the people who are playing.

Offline ACarlotti

  • *
  • Posts: 483
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #292 on: September 02, 2018, 08:51:58 PM »
Have you ever been able to (or tried to) diagnose why saves on the server are getting corrupted?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #293 on: September 02, 2018, 09:05:07 PM »
I have not tried this, as I am not sure quite where I would start in the diagnosis. One hypothesis - so far untested - is that the corruption might happen if the server restarts to apply an update to Linux, which is set to occur automatically for security reasons, during a load/save cycle.

If you have any ideas for looking into this, I should be most interested.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #294 on: September 02, 2018, 09:15:41 PM »
Restarting during or shortly after save/load cycle would explain the corruption. Files are not written out immediately to disks unless explicitly ordered to do so, instead they will be streamed out over time thanks to file caches.

The solution would be to schedule Linux updates to happen when the server is restarting with the nightly.
  • Build Nightly.
  • Warn of impending server shutdown.
  • Shutdown Server.
  • Apply Linux Updates (if any).
  • Restart system (if updates applied, or maybe anyway).
  • Start Server.
Linux is cryptic so I do not know how one would do this. However surely it must be possible...

Offline ACarlotti

  • *
  • Posts: 483
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #295 on: September 02, 2018, 10:21:52 PM »
For that hypothesis you could try logging the times at which saves are created and loaded, and compare these to the times at which the server is restarted. You could also try applying mitigation along the lines DrSuperGood suggests.

However, I don't see how that cause should lead to earlier saves being corrupted too, unless those earlier saves were made not long before the most recent one (so were still in a cache when the server made the next save). I think having earlier saves corrupted too does rule out a bug in Simutrans, but I'm not certain of this.

Another thing to consider (although I don't know how testable this is) is whether the corruption is down to small errors (perhaps indicative of a dodgy/failing disk), or whether the save is significantly damaged or truncated (which would be more indicative of it having never been fully written in the first place).

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #296 on: September 02, 2018, 11:01:21 PM »
The server is professionally hosted and corruption usually consists of a file a fraction of the size of the full save (e.g. ~10MB instead of ~76MB). The backups are made by discarding the oldest backup, copying the second oldest backup to the name of the oldest backup and so forth until the current saved game is copied to the newest backup slot. There are a total of six slots and this rotation does not occur unless the fresh saved game has changed, so this would, I imagine, explain the way in which the very latest backup becomes corrupt. This would mean that the latest uncorrupted backup is in fact the most recent uncorrupted game that was ever saved by the server.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #297 on: September 03, 2018, 03:53:35 AM »
Except that could not be the case as the save I provided was more recent than the one restored to. I am pretty sure I was still connected when playing...

Are we going to restore to the version I provided? If not I will just have to spend more hours rebuilding what I lost sigh...

Offline ACarlotti

  • *
  • Posts: 483
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #298 on: September 03, 2018, 05:38:40 AM »
copying the second oldest backup to the name of the oldest backup
I hope you're just renaming the old files, and not making new copies of them? Otherwise that would explain why older saves are getting lost, and also provides a fairly simple fix for that issue.

Except that could not be the case as the save I provided was more recent than the one restored to
I don't see any contradiction here: the fact that you have an uncorrupted save stored locally does not mean that a corresponding save was successfully written to the server's disk.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #299 on: September 03, 2018, 06:01:32 AM »
Quote
I don't see any contradiction here: the fact that you have an uncorrupted save stored locally does not mean that a corresponding save was successfully written to the server's disk.
And why would it not be successfully written to the server? I played for many minutes after the save was made which should be more than enough time for all data to be written out. Of course this assumes that the file cache is set to periodically write out changes and not just wait until cache eviction to write them out, which I guess would be a sensible settings for some server applications.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #300 on: September 03, 2018, 10:33:32 AM »
Thank you for your thoughts. Firstly, as to the backups - I have looked at the old backup rotation script that I had written back in 2012 to deal with backing up saved games. This used the Linux "cp" command. I have now modified the script to replace the "cp" command with the "mv" command for all but the first backup (as it is important that the first backup is indeed a copy, as the original file needs to remain untouched). However, this would not address the issue described here, as the only corrupt backup was the first, which was (correctly) a copy of the current server save file.

I have looked over the logs and cannot find anything of significance: what appears to have happened on the 31st is that the saved game became corrupted at some point (I do not have the exact time as many of the logs were not timed - I have now modified this) and there came a point when the game could not be restarted. If Dr. Supergood's save was an automatic rather than a manual save from his end, I am not clear on why this failed on the server other possibly than that this was relating to cache settings, which I am not entirely sure how to adjust (a brief search has not yielded clear results - do either of you know how to adjust these?).

I have now restarted the server with the restored saved game provided by Dr. Supergood; I have also taken the opportunity to increase the maximum commuting time tolerance to 3 hours and also increase the maximum visiting time tolerance to 6,015 minutes and the minimum visiting time tolerance to 12 minutes (up from 8) to reflact changes made to the pakset since the server game was originally created.

I do note, however, that Dr. Supergood's saved game also does not appear to have password data retained. I have backed up the saved game that was in use on the server until this restoration in case of difficulty.

Offline ACarlotti

  • *
  • Posts: 483
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #301 on: September 03, 2018, 12:02:55 PM »
The 'sync' command (which optionally can be given a list of files to sync) should "Synchronize cached writes to persistent storage". So calling that after the copy (and perhaps also once after finishing all operations) would be a good idea. 'sync' is intended for exactly this sort of situation.

The other thing you could do is to first copy the save to a file with a different name to the ultimate backup, then sync the write, and then rename the save to the actual backup name. This should ensure that you never end up with a partial backup save file (except under the temporary name).

Also, I would expect replacing cp with mv (where possible) to significantly improve the time taken to save the backups.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #302 on: September 03, 2018, 07:38:26 PM »
Quote
I do note, however, that Dr. Supergood's saved game also does not appear to have password data retained. I have backed up the saved game that was in use on the server until this restoration in case of difficulty.
Obviously it does not as I am not the server... Only the server has the password data for security reasons (if I had it, I could login as anyone I wanted to). Password data is stored in a separate file next to the game save. The game save file is transferred to clients so for the passwords to be kept secure they must be stored separately in an unrelated file that is not transferred to clients but is used by the server to authenticate passwords.
Quote
Also, I would expect replacing cp with mv (where possible) to significantly improve the time taken to save the backups.
A modern drive system should be writing large files at over 20MB/sec so even the massive server save is at most 5 seconds, probably far less.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #303 on: September 03, 2018, 09:21:50 PM »
Thank you for that suggestion: I have now added sync commands where sensible, and also replaced one instance of a forced shutdown with a shutdown using nettool in case this was responsible for the difficulties.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #304 on: September 05, 2018, 01:15:52 PM »
The server has been down for the last 4 hours apparently.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #305 on: September 05, 2018, 09:31:59 PM »
Thank you for the report. This seems to have been another corrupt saved game incident. I have restored from the backup, but I am not sure what is causing this.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #306 on: September 09, 2018, 10:42:48 PM »
What is the value of max_diversion_tiles? I am trying to replace the bridges over Crandon station but cannot remove one of them, even though I have built a 12-tile long diversion.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #307 on: September 09, 2018, 11:41:32 PM »
Quote
What is the value of max_diversion_tiles?
I think about 8-10 tiles. A diversion must also be of equal or better axel load. So for example you cannot divert a cobblestone road over Tar MacAdam road despite a higher speed limit but you can divert it over Tar MacAdam (heavy) road.

Honestly I do not like the public way system at all. It happily turns your bridges into public ways inside a city but it does not take the maintenance away from them in the process. It also is a real pain to upgrade bridges to higher tonnage as a result. It also will not let you downgrade public ways to at least the current public way type (inner city for pavemented roads, otherwise between city for non pavement).

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #308 on: September 09, 2018, 11:48:39 PM »
A diversion must also be of equal or better axel load. So for example you cannot divert a cobblestone road over Tar MacAdam road despite a higher speed limit but you can divert it over Tar MacAdam (heavy) road.
Thank you, I am perfectly aware of that ;)

Anyway, I lost my first attempt in a crash, and my second attempt succeeded. However, whether a bridge will be removed seems a bit random at times.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #309 on: September 10, 2018, 01:04:28 AM »
Quote
However, whether a bridge will be removed seems a bit random at times.
Unless the bridge itself is a diversion it will not start out as a public way. City buildings cause the ramp/span ways to become public ways if they are created in the surrounding times. If a bridge is inside a city it need not necessarily become a public way and as such can be deleted at the owner's leisure. However if it does then the annoying diversion rules apply.

Offline SuperTimo gb

  • *
  • Posts: 62
  • Languages: English, French
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #310 on: September 12, 2018, 02:39:15 PM »
All the extended servers seem to be down at the moment. It is not even possible to access the server list page: http://list.extended.simutrans.org:8080/list

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #311 on: September 12, 2018, 02:52:12 PM »
That suggests an error with the listing server, which I do not run. As a workaround, you can access thus server by typing net:bridgewater-brunel.me.uk in the load game dialogue.

Offline SuperTimo gb

  • *
  • Posts: 62
  • Languages: English, French
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #312 on: September 12, 2018, 03:06:59 PM »
Thanks, the server is indeed running, I tried putting the URL but put in the https:// url which obviously didn't work.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #313 on: September 14, 2018, 08:35:51 AM »
Cannot connect to the server. Not sure if its because people are joining or because it has crashed.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #314 on: September 14, 2018, 12:05:15 PM »
Thank you for the report. We seem to have had saved game corruption again: I have restored from the latest backup, so this should be running again shortly.