Page MenuHomePhabricator

Gerrit LFS objects lack an automatic sync to gerrit replicas
Closed, ResolvedPublic

Description

When pushing LFS objects to gerrit, they (currently) end up on gerrit1001. But they never make their way to gerrit replicas as gerrit2001 automatically.

Hence, fetching LFS objects from master works. But on replicas, fetching new LFS objects (ie. LFS that got created after the last manual sync) from replicas fails.

(This is unrelated to the recent Gerrit 3.2.2 upgrade. This issue existed before on Gerrit 2.15 just the same)

Event Timeline

Dzahn subscribed.

Hey, new subscribers. In our meeting today we talked about this and said that LFS data is not needed on replicas. But we also said there is this ticket about not having replication for LFS data. So it's both not needed now BUT this ticket is also still valid which says they SHOULD make their way to the replica host?

<+hashar> LFS data is only fetched for scap deployed repo and all use case point to the primary

confirmed!

Resolving based on the most recent comment. @QChris, please reopen if this doesn't address the use case you had in mind.

This still needs to be addressed. The data pushed over LFS are only available on the primary Gerrit and the replication plugin does not synchronize them to the replicas.

Isn't this a conflict with the statement that LFS data is not needed on replica hosts?

Isn't this a conflict with the statement that LFS data is not needed on replica hosts?

Although there is nothing fetching LFS data from the replica, when we switch over from the primary to the replica I'd rather have the LFS data present there to save a rsync. Same if we happen too loose the primary machine, that saves us from having to restore from backup.

I have looked a few system:

  • systemd timers triggering rsync
  • lsyncd which uses inotify+rsync for live updates
  • DRBD which means adding yet another tool

And in the end I am pretty much convinced the LFS data should be saved by Gerrit to Swift/Ceph over S3 API and stop caring of replicating those objects. This way if we switch over, all data are available over S3 and on the Gerrit side there is little complexity.

The only devils are:

  • finding out whether to use the ongoing Ceph installation or whether to use the existing Swift
  • how to transfer existing objects from the Gerrit server filesystem to S3

systemd timers triggering rsync

For that all we need is to use rsync::quickdatacopy like we use it all over the place and set "autosync = true". It already comes with timers and script that is started by the timer. That seems by far the easiest solution, fwiw.

LSobanski triaged this task as Medium priority.Jul 20 2023, 1:46 PM

Change 987135 had a related patch set uploaded (by EoghanGaffney; author: EoghanGaffney):

[operations/puppet@production] [gerrit] Add rsync job for lfs sync

https://gerrit.wikimedia.org/r/987135

Change 987135 merged by EoghanGaffney:

[operations/puppet@production] [gerrit] Add rsync job for lfs sync

https://gerrit.wikimedia.org/r/987135

This was deployed and running correctly!