Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xrdfs stat call help #1837

Closed
maksiks opened this issue Nov 29, 2022 · 7 comments
Closed

xrdfs stat call help #1837

maksiks opened this issue Nov 29, 2022 · 7 comments
Assignees

Comments

@maksiks
Copy link

maksiks commented Nov 29, 2022

Hi Everyone,
Is there any way for me to manipulate what flags xrdfs stat call returns?

Right now below is what this call returns for our files, as you can see
Flags: 48 (IsReadable|IsWritable)
I need to add to them Offline and BackUpExists flags. How do I do that?
Thank you, --Max

xrdfs root://dtn20.nese.rc.fas.harvard.edu:1094/ stat /store/data/Run2022D/ParkingDoubleMuonLowMass0/RAW/v1/000/357/538/00000/01d5d7e3-4fa1-4dba-bf06-8fc9bf9c9cb0.root
Path: /store/data/Run2022D/ParkingDoubleMuonLowMass0/RAW/v1/000/357/538/00000/01d5d7e3-4fa1-4dba-bf06-8fc9bf9c9cb0.root
Id: 520000709958041673
Size: 3704685885
MTime: 2022-11-23 02:14:22
CTime: 2022-11-23 02:14:22
ATime: 2022-11-23 02:14:24
Flags: 48 (IsReadable|IsWritable)
Mode: 0600
Owner: xrootd
Group: xrootd

@smithdh
Copy link
Contributor

smithdh commented Nov 29, 2022

The Offline and BackUpExists status can be signal in the 'st_rdev' element of the 'struct stat' structure that the server fills to return information about a file. I'm not certain where to suggest you fill this, the easiest place could depend on your configuration and particularly if you're customising xrootd, e.g. with plugins.

I did just see your earlier question on the cta-dev list, so I'm making some assumptions about your configuration: I believe you may be using the standard Ofs & Oss (i.e. mostly standard xrootd server), on top of GPFS as the filesystem, and probably using a custom 'preplib'? - in that case I believe you could additionally use a 'statlib':

There is some information about configuring a "statlib" here: https://xrootd.slac.stanford.edu/doc/dev56/ofs_config.htm (section 5.9).

To signal Offline or BackUpExists one has to set st_rdev to 0 (strictly speaking XRDSFS_RDVMASK bits have to be 0), and then set XRDSFS_OFFLINE (to indicate offline) or XRDSFS_HASBKUP (to indicate BackUpExists).

@maksiks
Copy link
Author

maksiks commented Nov 29, 2022

Hi, our end point is indeed uses xrootd on top of posix compliant file system (GPFS over NFSv4).
We do use preplib: ofs.preplib libXrdOfsPrepGPI.so -debug -admit all -run /cms/...

From your response is that I should put into the config
oss.statlib /cms/.../statlib.py
where statlib.py would by my custom script that will return what is needed?

@abh3
Copy link
Member

abh3 commented Nov 30, 2022 via email

@abh3
Copy link
Member

abh3 commented Dec 1, 2022

I do understand your predicament. I have forwarded this ticket to OSG for consideration.

@abh3 abh3 self-assigned this Dec 1, 2022
@abh3 abh3 added the Discussion label Dec 1, 2022
@maksiks
Copy link
Author

maksiks commented Dec 2, 2022

Another question that came up: the set of flags this call produces is based on certain commands that are issued for FS or it is just the type of FS that determines the response? Is there any way we can manipulate our FS responses that would produce right set of flags?

@abh3
Copy link
Member

abh3 commented Dec 2, 2022 via email

@abh3
Copy link
Member

abh3 commented Oct 12, 2023

I believe this ticket or was handled by OSG so I am closing this.

@abh3 abh3 closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants