Skip to content

Changeset replication stopped #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pa5cal opened this issue Jan 2, 2021 · 5 comments
Open

Changeset replication stopped #8

pa5cal opened this issue Jan 2, 2021 · 5 comments

Comments

@pa5cal
Copy link

pa5cal commented Jan 2, 2021

The changeset replication stopped this morning again.
Latest state file has been created at:
last_run: 2021-01-02 07:11:01.391104000 +00:00
sequence: 4262676

See: https://planet.openstreetmap.org/replication/changesets/

@zerebubuth
Copy link
Owner

Happy New Year 🎆

Thanks for letting me know - I've just restarted it.

For posterity, the error leading to a zero-size state file (with an intact state.yaml.tmp, though), was:

Error! Couldn't update state.
ERROR: Bad file descriptor @ fptr_finalize_flush - /store/planet/replication/changesets/state.yaml.tmp

So it looks like the temporary state file handle is bad when the file pointer is finalized. The file handle is only in scope for a single block, and should be automatically closed (and flushed) when that block ends. But apparently it isn't, and I can't figure out why. 😖

It looks like the call to FileUtils.cp to copy the temporary state to the main state file is the point at which it fails, based on the contents/existence of the files on disk. What I could see was:

  1. The target data file existed (004/262/678.osm.gz)
  2. The target state file did not exist (004/262/678.state.txt)
  3. The state temporary file existed, and was complete (state.yaml.tmp)
  4. The main state file existed, and was zero-size (state.yaml)

FileUtils.cp seems to be implemented pretty much as File.open(src) {|s| File.open(dst, 'wb') {|d| d.write(s.read()) }}, so the File.open(dst, 'wb') seems to have run, as that would truncate the target file. But then the d.write hasn't run, therefore it must be the s.read() which triggered the finalizer on the previous open of that file?

This is some strange stuff going on. @gravitystorm, you're much more familiar with Ruby than I - does this ring any bells for you?

(PS: @pa5cal, thanks for letting me know. Please don't feel like you need to, though! I had a very full inbox when I woke up this morning, something like >200 error emails from the changeset replication process.)

@pa5cal
Copy link
Author

pa5cal commented Apr 11, 2021

@zerebubuth Could you/someone else please check the changeset replication process?
It stopped working yesterday, thanks!

@zerebubuth
Copy link
Owner

Thanks @pa5cal! And apologies - I would have fixed it sooner, but it has been a busy morning 🙇‍♂️

@pa5cal
Copy link
Author

pa5cal commented Aug 23, 2021

@zerebubuth Could you check the changeset replication process?

See https://planet.openstreetmap.org/replication/changesets/
state.yaml 2021-08-23 01:55 0

@zerebubuth
Copy link
Owner

zerebubuth commented Aug 23, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants