ericaltendorf / plotman

Chia plotting manager
Apache License 2.0
909 stars 280 forks source link

archive rsyncd on host1 and local_rsync on host2 write to the same HD (mounted on host2) #847

Open jayhohoho2019 opened 3 years ago

jayhohoho2019 commented 3 years ago

Describe the bug

After upgrading to v0.5, local_rsync and rsyncd from two hosts are rsync'ing to the same HD somehow, even though there are multiple HDs with enough free space, and the two hosts have plotman archive index set at different values. To Reproduce

Steps to reproduce the behavior, e.g.:

  1. Set up config with '...'
  2. Run other programs '....'
  3. Run Plotman with '....'
  4. See error

Expected behavior

System setup:

Config

full configuration ```yaml # paste your complete configuration file contents here. ```

Additional context & screenshots

altendky commented 3 years ago

6 and 4 are weird numbers vs. 1 and 0. But, note that the index: parameter belongs directly in archiving: not archiving: env:. But, since you didn't share your config as requested in the template, I just have to guess at this being the problem.

jayhohoho2019 commented 3 years ago

Configs from both machines copied below. So it looks like the index is in the right place. Note I never noticed this issue prior to the upgrade to v0.5. As to the index values, I thought as long as they are different that's Ok. Could you confirm? My eventual setup will have multiple plotters (6 at least) using rsyncd mode to a file server which is running local_rsync. Each will have a unique index. This setup is supposed to be supported, correct?

archiving:
  index: 4
  target: local_rsync
  env:
    command: rsync
    site_root: /mnt/farm
archiving:
  index: 6
  target: rsyncd
  env:
    site_root: /mnt/farm
   ...
altendky commented 3 years ago

It looks like it presently just saturates based on the length of the list of drives with available space.

https://github.com/ericaltendorf/plotman/blob/3edef7ef97e0d4670322ae586823f4bbb1fc3c76/src/plotman/archive.py#L243

So if you have three archive drives with free space and indexes four and six, both will end up archiving the the third drive. I think perhaps that should change to a modulus or something, maybe. But even then if you pick two arbitrary numbers they might end up referencing the same disk.

How many free disks do you have? Starting with screenshots and full configuration files can help avoid the need for back and forth on questions like this.

jayhohoho2019 commented 3 years ago

I see. My free disk count changes over time when some are filled, and eventually unmounted and moved (and replaced by new free disks). When this issue happened, there were only 2 HDs that had free space under site_root. So it looks like both ended up getting an index value of 1.

jayhohoho2019 commented 3 years ago

I'll change the index values to 0 and 1 for now. That makes sense. When number of plotters goes up I'll increment the index accordingly.

altendky commented 3 years ago

If I switch it to modulus rather than limit then you would be able to just use 0, 1, 2, 3, ... indexes and still get the best spread possible since the actual disks used would be 0, 1, 0, 1, ... instead of the present 0, 1, 1, 1, ....

See the change to modulus in https://github.com/ericaltendorf/plotman/pull/855.

jayhohoho2019 commented 3 years ago

Ok thank you.

On Mon, Jul 12, 2021, 8:38 AM Kyle Altendorf @.***> wrote:

If I switch it to modulus rather than limit then you would be able to just use 0, 1, 2, 3, ... indexes and still get the best spread possible since the actual disks used would be 0, 1, 0, 1, ... instead of the present 0, 1, 1, 1, ....

See the change to modulus in #855 https://github.com/ericaltendorf/plotman/pull/855.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ericaltendorf/plotman/issues/847#issuecomment-878244794, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOD6DTX7NT47ZBKIOILUFELTXLO4LANCNFSM5AE7GMQA .