Closed MichalBryxi closed 2 months ago
Thank you for describing this problem precisely. I think the reason is that there is not 5 days of data stored in mongodb for providers that have a high update rate like Holfuy because we are simply using capped collection with a maximum documents and size: https://github.com/winds-mobi/winds-mobi-providers/blob/main/winds_mobi_provider/provider.py#L80
We could create a background process that cleans up the measurement collections based on time, but that's not a priority currently in my opinion.
I took a look in measurements collections:
winds> db["holfuy-1293"].stats()
{
capped: true,
max: 5000,
maxSize: 500224,
sharded: false,
size: 500214,
count: 4134,
storageSize: 204800,
totalIndexSize: 94208,
totalSize: 299008,
indexSizes: { _id_: 94208 },
avgObjSize: 121,
}
Holfuy collections are reaching the capped limits of a size of 500K and a max of 5000 records.
When I started winds.mobi, capped collections were the only way to limit the size of a collection. Today, mongodb recommends to use TTL index. But:
I think that I'll write a mongosh script that clone all the capped collections to new regular collections with a TTL index.
@MichalBryxi
Here is the PR: https://github.com/winds-mobi/winds-mobi-providers/pull/98
Spanish village to me :) , but 🙇🏾 for addressing this issue. Now it seems like it's re-collecting the data as all the weather stations seems to have "only" ~1.5 days of data.
Thanks for the quick fix. I think I can just close this one.
seems to have "only" ~1.5 days of data.
Yes, unfortunately, I had an issue during the migration. I tested the mongosh script locally but when I ran it in production the timing was different and monodb expires the measurements earlier. I lost all the measurements 😢 Well, history is rebuilding now.
Steps to reproduce
1) GOTO: https://winds.mobi/stations/map/holfuy-1804 2) Click on "wind" tab 3) Try to select: "Zoom: 5d" 4) Observe that nothing has happened
Expected behaviour
Screenshots