-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
Add more validations to .mbtiles detection #741
Comments
@nyurik I noticed this was causing absolutely horrific tail latency for tiles. We were using I'd be happy to take this on! |
Thanks @Auspicus , that would be awesome! |
It looks like this feature more or less exists inside the I'm thinking the following could be useful:
This could slow down the startup slightly and might require another config flag to turn off in the case the user wants to skip this check. Is it OK to make concessions on the startup time in the interest of ensuring a good experience with the server? So to summarize:
Thoughts? @nyurik |
Thx, I agree that something like this is needed. I am not a big fan of tons of bools, so perhaps something like this?
TODO
Config structureWe currently have this structure: mbtiles:
paths:
# scan this whole dir, matching all *.mbtiles files
- /dir-path
# specific mbtiles file will be published as mbtiles2 source
- /path/to/mbtiles.mbtiles
sources:
# named source matching source name to a single file
mb-src1: /path/to/mbtiles1.mbtiles So we may need to be able to add both mbtiles:
# overrides built in defaults
validate: skip
on_invalid: abort
paths:
# scan this whole dir, matching all *.mbtiles files
- path: /dir-path
# applies to all files in the dir
validate: skip
on_invalid: abort
# specific mbtiles file will be published as mbtiles2 source
- path: /path/to/mbtiles.mbtiles
# applies to the given file
validate: skip
on_invalid: abort
sources:
# named source matching source name to a single file
mb-src1:
path: /path/to/mbtiles1.mbtiles
# applies to the named source
validate: skip
on_invalid: abort CLI argumentsThe same values can be used from the CLI: |
@nyurik I've made a start here, haven't gotten around to adding the config to each individual source / path yet, but the integration tests seem to have caught an issue with the If you get a chance to review the PR so far, I'd love to know if I'm going in the right direction. Cheers! |
Not who you asked but chiming in anyway. What would be really helpful for this is to add an integration test here. Slightly offtopic (read not a reuqirement, but closely related work): |
As part of mbtiles type detection, we should catch some common issues:
tiles
(simple) ormap
(deduplicated) tables have an index by z,x,y columnsIn case of a problem, use a
warn!
macro to print a warning, unless we are certain the issue makes it impossible to use a file, in which case it should be appropriate error (add it to the error enum).A bigger discussion is if mbtiles should stop using logging, and return some
Vec<MbtilesWarning>
if non-critical issues are detected.The text was updated successfully, but these errors were encountered: