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
The pep_database_mod_data_obj_meta_* PEPs not called when new file uploaded #6385
Comments
I verified that this bug exists in 4.2.10 as well. |
That is correct. With the introduction of logical locking, we failed to realize that database PEPs weren't being triggered due to direct use of nanodbc. We will restore this ability in 4.2.12, but not through that PEP. We will provide more details once work on 4.2.12 picks up. Below are a couple ways to get around this limitation:
|
Which
|
this is in the service of having a checksum on every object, so, a two-prong approach is probably recommended anyway:
So, until we know exactly how many PEPs to instrument/define/use - the following lists can help us get there... yes
pretty sure no
|
I figured out how to trigger the following "yes" PEPs.
But I couldn't figure out how to trigger the following ones.
How does one trigger these PEPs? |
It depends on the API being invoked by the client. Each of these PEPs have client-side API endpoints. The only way to trigger them is if the client directly invokes one of those calls. A quick search in the irods repo and icommands repo indicate that the following PEPs are never invoked by the icommands:
|
So I need to use python-irodsclient or another client library to trigger the following.
If Also, how do I trigger |
I figured out how to trigger |
Agreed. We will capture that in the docs. |
It looks like |
|
I think we can restore a hook similar to I already had something similar to this (albeit, for different reasons) on standby in a draft PR from way back: #5664 |
That makes sense to me. The atomic API plugins share the same issue (that is, they don't trigger any database PEPs because they reach out to the database directly). Can discuss more next week. |
It occurred to me this morning that |
Looking at the docs, that PEP doesn't appear to expose any info about what was modified. Am I missing something? |
The plugin context should have all of the information necessary to determine what was modified. Otherwise, the coordinating resources themselves wouldn't be able to perform their "modified" functions (e.g. sync to archive, replicate, etc.). However, if the rule does not have access to the plugin context, then it wouldn't be able to access the info itself. I could be wrong. |
This just means we need to add examples to the developer docs so no one has to figure it out anymore. That will be covered by the starter project template work I'm still working on. Carry on. |
I tried implementing For reference, here's the information available in the context (I removed the "++++" delimiters and put each value on its own line):
It may not be everything one might want, but you get the logical path, resource hierarchy, and some other goodies so, it should serve a good many use cases, I'd imagine. |
I haven't tried that PEP. It looks useful. Thanks for pointing it out. |
This adds a test which ensures that the dynamic post-PEP for the data object finalize database operation runs after a variety of different operations. Also gives a first application to the JSON microservice family.
This adds a database plugin operation for use in the data_object_finalize API plugin. This is meant to act as interchangeable logic with the nanodbc-based database interactions which exist in the API plugin today. This change is needed in order for zone administrators to implement policy around data objects being created or modified in the system. In the past, this was possible because of the "mod data obj meta" database operation. This was discarded in favor of the nanodbc-based operations built directly into the data_object_finalize API plugin. This new database operation should act as a replacement. Due to logical locking, this database operation will be enacted once when the data object is opened and once when it is closed. The rule implementer is responsible for taking the appropriate action.
This adds a test which ensures that the dynamic post-PEP for the data object finalize database operation runs after a variety of different operations. Also gives a first application to the JSON microservice family.
This adds a database plugin operation for use in the data_object_finalize API plugin. This is meant to act as interchangeable logic with the nanodbc-based database interactions which exist in the API plugin today. This change is needed in order for zone administrators to implement policy around data objects being created or modified in the system. In the past, this was possible because of the "mod data obj meta" database operation. This was discarded in favor of the nanodbc-based operations built directly into the data_object_finalize API plugin. This new database operation should act as a replacement. Due to logical locking, this database operation will be enacted once when the data object is opened and once when it is closed. The rule implementer is responsible for taking the appropriate action.
This adds a test which ensures that the dynamic post-PEP for the data object finalize database operation runs after a variety of different operations. Also gives a first application to the JSON microservice family.
This adds a database plugin operation for use in the data_object_finalize API plugin. This is meant to act as interchangeable logic with the nanodbc-based database interactions which exist in the API plugin today. This change is needed in order for zone administrators to implement policy around data objects being created or modified in the system. In the past, this was possible because of the "mod data obj meta" database operation. This was discarded in favor of the nanodbc-based operations built directly into the data_object_finalize API plugin. This new database operation should act as a replacement. Due to logical locking, this database operation will be enacted once when the data object is opened and once when it is closed. The rule implementer is responsible for taking the appropriate action.
This adds a test which ensures that the dynamic post-PEP for the data object finalize database operation runs after a variety of different operations. Also gives a first application to the JSON microservice family.
This adds a database plugin operation for use in the data_object_finalize API plugin. This is meant to act as interchangeable logic with the nanodbc-based database interactions which exist in the API plugin today. This change is needed in order for zone administrators to implement policy around data objects being created or modified in the system. In the past, this was possible because of the "mod data obj meta" database operation. This was discarded in favor of the nanodbc-based operations built directly into the data_object_finalize API plugin. This new database operation should act as a replacement. Due to logical locking, this database operation will be enacted once when the data object is opened and once when it is closed. The rule implementer is responsible for taking the appropriate action.
This adds a test which ensures that the dynamic post-PEP for the data object finalize database operation runs after a variety of different operations. Also gives a first application to the JSON microservice family.
This adds a database plugin operation for use in the data_object_finalize API plugin. This is meant to act as interchangeable logic with the nanodbc-based database interactions which exist in the API plugin today. This change is needed in order for zone administrators to implement policy around data objects being created or modified in the system. In the past, this was possible because of the "mod data obj meta" database operation. This was discarded in favor of the nanodbc-based operations built directly into the data_object_finalize API plugin. This new database operation should act as a replacement. Due to logical locking, this database operation will be enacted once when the data object is opened and once when it is closed. The rule implementer is responsible for taking the appropriate action.
This adds a test which ensures that the dynamic post-PEP for the data object finalize database operation runs after a variety of different operations. Also gives a first application to the JSON microservice family.
This adds a database plugin operation for use in the data_object_finalize API plugin. This is meant to act as interchangeable logic with the nanodbc-based database interactions which exist in the API plugin today. This change is needed in order for zone administrators to implement policy around data objects being created or modified in the system. In the past, this was possible because of the "mod data obj meta" database operation. This was discarded in favor of the nanodbc-based operations built directly into the data_object_finalize API plugin. This new database operation should act as a replacement. Due to logical locking, this database operation will be enacted once when the data object is opened and once when it is closed. The rule implementer is responsible for taking the appropriate action.
Bug Report
iRODS Version, OS and Version
iRODS 4.2.11, CentOS 7
What did you try to do?
I use the PEP
pep_database_mod_data_obj_meta_post
enforce various policies. One of those policies is ensuring that every replica has a checksum, In iRODS 4.2.8, when data object was created for an uploaded file, this PEP was called after the replica was created on a storage resource. Thedatabase_mod_data_obj_meta
operation was called to set the size of the new replica in the catalog.I tried to use iput to create a new data object having a checksum using this same rule logic in iRODS 4.2.11, but with a
writeLine('serverLog', 'database_mod_data_obj_meta');
added to the top of the rule attached topep_database_mod_data_obj_meta_post
.Expected behavior
I expect a newly uploaded data object having a checksum. I also expect to see a message in the server log mentioning
database_mod_data_obj_meta
.Observed behavior (including steps to reproduce, if applicable)
I use iput to upload a file, but the new data object doesn't have a checksum and there is no mention of
database_mod_data_obj_meta
in the server log.In 4.2.11, the
database_mod_data_obj_meta
operation isn't called when a file is uploaded, and a newly uploaded data object doesn't receive a checksum.It looks like the database plugin is being bypassed. With SQL logging enabled, I can see an
INSERT
statement that creates an entry for the data object and it's zeroth replica with size set to zero, but I don't see anUPDATE
statement that set's the replica's correct size after it has been written to the storage resource. However, the catalog has the data object's correct size.The text was updated successfully, but these errors were encountered: