Skip to content

Extract housekeeping management to its own package

housekeeping package responsible for controlling housekeeping maintenance tasks. Those clean up stale data, optimize Git's data structures such as packfiles, packed refs, bitmaps, etc. They are essential to improve the performance of Git operations as well as saving costs.

Recently, we added support for running housekeeping tasks in the context of write-ahead logging. This work uses some functionalities of the housekeeping package directly. At recent, those additions have been isolated in the transaction manager. We are looking forward to integrating the housekeeping-in-transaction with the existing housekeeping manager.

Unfortunately, as the transaction manager uses a subset of housekeeping already, the housekeeping manager could not use anything related to the transaction due to the circle importing issue. Thus, we need to either isolate housekeeping management logic or create a new package to handle new logic. The former solution makes more sense.

This commit extracts all housekeeping management logic to a new "internal/git/housekeeping/manager" package. This package is responsible for scheduling, determining which strategies to use, avoiding concurrent conflicts, etc. In the future, we'll need transaction support for this package. Housekeeping task execution logic still stays in "internal/git/housekeeping" package.

This is a prerequisite of Integrate transaction's housekeeping tasks to t... (#5733 - closed)

Merge request reports