-
Notifications
You must be signed in to change notification settings - Fork 6
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
Merging diff files #32
Comments
Maybe @brettch still remembers some of those details, or has some good pointers to the relevant bits in the code to get started. |
Yep, it looks like I wrote most of this code back in 2009 so my memory is a bit hazy on the details. Osmosis does use timestamps heavily. While timestamps in the state files may be a bit fuzzy, there are some guarantees available. The timestamp in a replication state file is greater than or equal to all data inside that changeset and those preceding it (I hope I have this right, it's important). Similarly, data in subsequent replication files may also be less than this timestamp due to late arriving data. It's eventually consistent. You can use the timestamps to determine when to start replicating and know that you'll eventually see all data created after that timestamp. Osmosis doesn't count files, or even really care what interval size you're using, it's generic in that sense. You can specify interval lengths in seconds if you wish, and that's what's I was striving for when I first wrote it. Osmosis is setup to create minute files initially because that's the minimal interval in cron, but it is possible to create a file every second if you wish. If at least one interval of data is available then Osmosis starts processing. It calculates a maximum interval prior to processing that is a multiple of the interval length based on what's available on the server. If a partial interval is available it won't process. If 1.5 intervals are available, it will process one interval and stop. Osmosis using the local state file at the root of the directory tree to figure out what the current local interval number (and associated timestamp) is. Therefore resetting is a simple matter of copying an earlier state file over the top and it will start from there again. If you want to understand the Osmosis date logic, the two main classes to look at are:
Hope that helps. |
To fully replace Osmosis, we need to merge minutely diff files into hourly and daily diffs and I am trying to figure out exactly how this should be done.
In normal operation the program will run
So far that's easy enough. But the question is: What should happen in special situations, say when the program didn't run for some reason and there are older minutelies lying around etc.
What I am bit unclear about is how osmdbt should figure out which minutelies to assemble into an hourly. If if just takes the next 60 it hasn't processed yet, the result might not correspond to full hours, because there might be minutelies missing. But it can't really look at the timestamps either, because its a bit fuzzy how they are generated. The Osmosis code is really hard to read so I haven't figured out yet what it is doing exactly.
In addition to that I would expect something like the following behaviour:
Any opinions on these issues?
The text was updated successfully, but these errors were encountered: