Hello @jackleland

I don't believe it's possible with the xroot protocol to supply a file checksum at file close (or open) and request that the server report/ensure that the file at time of close matches that checksum. The python File object options are reflecting that.

For xrdcp, the '-C' option causes the xrdcp application to add a step after the file is created, written and closed. It sends a 'query' command to the destination to request the checksum of the file is returned (so it has to be calculated or possibly fetched from file extended attributes on the server) and returned to the xrdcp application. The server has to be configured to allow that and to support a given type of checksum algorithm. xrdcp then compares the returned value to whatever reference value it has - it has some different ways of getting the value to match against. If it does mismatch it reports an error, but xrdcp doesn't take other action on the new file. One can do a similar query from python like this, e.g. python3:

from XRootD import client
fs = client.FileSystem("root://the.server.edu:1094")
status, resp = fs.query(client.flags.QueryCode.CHECKSUM,"/filename?cks.type=adler32");

if status.ok:
  resp = str(resp, "utf-8")
  vals = resp.split()
  print('checksum type='+vals[0], 'checksum value='+vals[1])

(selecting the checksum type with 'cks.type' has some subtleties, the server may not use this value, so you have to check the 'type' which is returned in the result). The python program would have to do the compare and take some action if the checksum is wrong.

(This is all separate from block level integrity checking, where for certain operations the client/server can supply the checksum of each, individually small, block of data being transmitted and expect the the peer will verify them).


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <xrootd/xrootd/issues/2071/1686194803@github.com>

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/issues/2071#issuecomment-1686194803", "url": "https://github.com/xrootd/xrootd/issues/2071#issuecomment-1686194803", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1