Vali Dragnuta scria la data de 7 Februarie 2006:
> Revin la ideea lui Dragos cu xfs_freeze:
> man xfs_freeze :
>
> xfs_freeze halts new access to the filesystem and creates a stable
> image on disk.
> xfs_freeze is intended to be used with volume managers
> and hardware RAID devices that support the creation of snapshots.
>
> .....
>
> The -f flag requests the specified XFS filesystem to be frozen from new
> modifications. When this is selected, all ongoing transactions in the
> filesystem are allowed to complete, new write system calls are halted,
> other calls which modify the filesystem are halted, and all dirty data,
> metadata, and log information are written to disk. Any process
> attempting to write to the frozen filesystem will block waiting for the
> filesystem to be unfrozen.
>
> ...ceea ce in caz ca "ongoing transactions" inseamna si un fisier
> deschis +w cred ca este exact ce vrei tu -
Da si nu. Cum spuneam, asta reduce sansele unui race condition, dar
nu le elimina. Exemplu:
(1) script-ul de sincronizare verifica timestamp-ul etc. si trage
concluzia ca trebuie sa porneasca rsync;
(2) Samba deschide primul fisier pentru update;
(3) script-ul de sincronizare cheama xfs_freeze;
(4) Samba termina de scris fisierul;
(5) script-ul de sincronizare porneste rsync.
Rezultat: primul fisier nou, celelalte vechi.
> singurul inconvenient este ca trebuie sa folosesti xfs.
Si faptul ca directorul respectiv trebuie sa stea intr-o partitie
separata. Problema filosofica aici e ca as prefera o solutie in care
scriu cateva script-uri pe care le instalez pe un sistem existent, nu
una in care construiesc un sistem in jurul catorva script-uri. :-) In
sfarsit, deocamdata nu sunt nici macar acolo.
O solutie rezonabila ar presupune un mecanism de (write) locking
pentru Samba. Ideal, script-ul de sincronizare ar crea (atomic) un
lockfile, iar Samba s-ar abtine sa scrie in directorul respectiv atat
pana cand fisierul respectiv este sters, eventual permitand in timpul
asta citiri.
Salutari,
Liviu Daia
--
Dr. Liviu Daia http://www.imar.ro/~daia
_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug