Menu

1 / 2

A prefix away from deleting a live file: fixing Geo's in-use check

DEV Community: ruby·Priyanshu Jha·2 days ago
#b8hiVPzm
#devtoruby#devto#dev#store_path#path
Reading 0:00
15s threshold

GitLab Geo keeps a secondary site in sync with a primary. When a file is deleted on the primary, the secondary has to delete its copy too. That sounds simple, until two records share a path, or the path the secondary stored is not quite the path the "is this still in use?" check looks at.

This is the story of gitlab-org/gitlab!265937 , which stopped Geo from treating a perfectly live object-storage file as unused. I'll cover the issue, the plan, the two-path check, a local-path trap that made a one-sided fix dangerous, and the review that tightened the specs.

The issue: a safety check that never matched

The issue was gitlab-org/gitlab#636176 , opened by Chloe Fons. It came out of work to roll out a feature flag, geo_blob_removal_uses_registry_location ( #635220 ).

Some background. On a Geo secondary, each blob registry row stores a blob_path : the file's path relative to its uploader root, or its object storage key.…

Continue reading — create a free account

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