Thanks to visit codestin.com
Credit goes to github.com

Skip to content

iRODSDataObject(...).modify_time is arbitrarily chosen #746

@d-w-moore

Description

@d-w-moore

The various DataObject model attributes are chosen based on the first row in the query result-set, which is ordered by replica number. This affects the data object's "overall" timestamp info among other attributes:

session=irods.helpers.make_session( )
data_obj = session.data_objects.get( path_to_data_object )
print(repr(data_obj.modify_time))# -> this will not give the most recent replica's timestamp
max(r[DataObject.modify_time] for r in data_obj.replicas) # -> this will give most recent replica's timestamp

The printed datetime object will not necessarily reflect the most recent replica's modification timestamp.

For that we'd have to put in a hook to sort the result set before transferring the attributes to the main object. (I am thinking that is the most efficient option,and most backward compatible, since the PRC mostly relays cached attributes anyway and relies on the user to do fresh queries to re-poll the object for changes.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions