It led me to the find_next_pixels_data_per_user_for_null_repo query in `components/model/resources/ome/util/actions/default.properties`. This is: (I've filled in the `572962` according to my own situation):
- Code: Select all
select * from (
select *, row_number() over (partition by entityid) as dupe
from (
select e.experimenter, el.id as eventlog, entityid, row_number() over (partition by experimenter) as row
from event e, eventlog el, pixels p where
e.id = el.event and el.id > 572962 and action = 'PIXELDATA' and entitytype = 'ome.model.core.Pixels'
and p.id = el.entityid group by e.experimenter, el.id, el.entityid) as x where row <= 5 order by row, eventlog asc) as y where dupe = 1
The output of this query is as follows:
- Code: Select all
experimenter;eventlog;entitityid;row;dupe
252;573263;7169;1;1
252;573476;7224;2;1
252;573541;7212;3;1
252;572965;7505;4;1
252;573381;7287;5;1
Take note of the `eventlogId` and the `row` column. As you can see the the eventlogId jumps quite randomly. And this also causes the the image handled in pixeldata/PersistentEventLogLoader.java to skip forward, and over evenlogId it hasn't processed yet. Because if it picks up a eventlogId later in the list it will execute the query above with this new ID, and then never complete any remaining eventLogIds lower than this number.
To confirm my suspicion that this was the issue. I've changed the query to no longer order on `row` but only on `eventLogId` and instead of keeping `row` < 5, I've limited the output by `5`. This is the final query:
- Code: Select all
select * from (select *, row_number() over (partition by entityid) as dupe from (select e.experimenter, el.id as eventlog, entityid, row_number() over (partition by experimenter) as row from event e, eventlog el, pixels p where e.id = el.event and el.id > 573849 and action = 'PIXELDATA' and entitytype = 'ome.model.core.Pixels' and p.id = el.entityid group by e.experimenter, el.id, el.entityid) as x order by eventlog asc limit 5) as y where dupe = 1
Typical output of this query is:
- Code: Select all
experimenter;eventlog;entitityid;row;dupe
252;573850;7132;23;1
252;573851;7127;4;1
252;573852;7142;15;1
252;573853;7140;11;1
252;573854;7145;8;1
Note the order of the `eventlog` column, and the `row` is not any more.
And this indeed fixed the issue, and now eventlogIds are processed in order. And no images are skipped anymore. However, I've no idea if this is the correct fix. It has as side effect that only one thread is processing pixels, and all the others are trying to handle the previous eventlogid (log message SKIPPED ...).
Please tell me if you need additional log files
[update]This query did not fix all cases. But I still think the root cause of the issue might be related to this query.[/update]