You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Disable stats importation when the trackers starts #1510
And one of the problems is that the downloads counter (for all torrents) is not initialised with the latest value when the tracker starts. The current way to keep the counter is to load from the database the number of downloads per torrent. It was implemented only when the torrent is added to the tracker but not when the tracker starts. This gives you a wrong general counter because inactive torrent downloads are not counted. I changed the code to fix it in this PR:
But after deploying the patch to the demo tracker, the server could not start (unhealthy tracker container).
The reason was that there are 1.893.901.614 torrents!!! in the demo tracker. The database is 17G:
ls -alh storage/tracker/lib/database/sqlite3.db-rwxrwx--- 1 torrust torrust 17G May 8 17:53 storage/tracker/lib/database/sqlite3.db
That was probably the reason why the function to import torrents from the database (pub fn import_persistent(&self, persistent_torrents: &PersistentTorrents)) was not being used. Maybe it was disabled at some point because we realised it was not feasible with many torrents. However, when it was disabled, we didn't realise that it affected the downloads counter when the tracker is restarted.
I will disable it. Anyway, I was planning to implement an alternative solution here. The alternative solution does not work either because we have to run a query to sum up torrents, which will probably be costly. I guess we need to store directly the global counter (persistent metric). I will think of a new solution and update that issue.
Activity
fix: [torrust#1510] disable torrent stats importation at start
fix: [torrust#1510] disable torrent stats importation at start
Merge #1511: Disable torrent stats importation at start