Menu

1 / 2

Two queries too many: removing each_batch from GitLab's Maven snapshot cleanup

DEV Community: postgres·Priyanshu Jha·3 days ago
#P3TXNWFi
#devtopostgresql#devto#dev#gitlab#database
Reading 0:00
15s threshold

The final diff of gitlab-org/gitlab!270142 is tiny: a handful of lines in the service and a few more in its spec. But getting it merged took a database review with real production query plans, two spec improvements from a reviewer who tested them by breaking the code on purpose, and a Danger failure I caused myself.

This post covers what the issue was, why each_batch was the wrong tool here, how the specs got stronger in review, and what database review looks like when you're a community contributor without access to GitLab's production database tools.

The issue: a batch loop over something already batched

The issue was gitlab-org/gitlab#639257 , opened by Tim Rizzi. It came from a suggestion by Daniyal Arshad in the review of an earlier MR ( !266409 ), which added a Maven snapshot pass to the package cleanup policy.

Some background. Packages::Cleanup::ExecutePolicyService runs a project's package cleanup policy.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.