Batch persisted download writes

Open
#2,418 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Read the specification at docs/issues/open/2418-batch-persisted-download-writes/ISSUE.md and resolve the stated blocker, #1488, before starting. Measure the persistent completed-downloads listener first, then investigate how its writes and shutdown flush are handled. Done means meeting the agreed rate target, satisfying the delta and outcome acceptance criteria across all drivers, and passing relevant tests and linter all.

Written by the indexing model from the issue text.

Description

Blocked database performance

Independent follow-up to #2410. Blocked until #1488 is done: measure the persistent completed-downloads listener first, then batch its writes.

Goal

The persistent completed-downloads listener keeps up with the completion rate under load, so its event backlog stays small in normal operation and at shutdown.

Acceptance criteria

  • AC1: From recorded nonzero baselines, per-torrent deltas match each torrent's completions and the global delta matches their sum, on all drivers.
  • AC2: Rate meets the target agreed after T1, with comparable before/after numbers and no unreviewed latency or memory regression.
  • AC3: Rollback, retry, discard, and unknown outcomes are tested and logged distinctly; retry cannot silently double-count an ambiguous commit.
  • AC4: Shutdown flushes the batch within available time, or reports the deadline/failure outcome without claiming persistence completed.
  • linter all exits with code 0; relevant tests pass.

Specification: docs/issues/open/2418-batch-persisted-download-writes/ISSUE.md (added by the spec-only PR).

Dominant language
Rust
Stars
532
Forks
56
Avg merge
11h 20m
Merged PRs (30d)
282

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from torrust/torrust-tracker

All issues in torrust/torrust-tracker

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.