Elasticsearch not updating indexed items when access rules change

Bug #1738898 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
16.10
Fix Released
High
Unassigned
17.04
Fix Released
High
Unassigned
17.10
Fix Released
High
Unassigned
18.04
Fix Released
High
Robert Lyon

Bug Description

When a page has it's access rules changed (but not other editing) the elasticsearch does not update the index for the items involved.

There is an add_to_queue_access() function that is meant to check what pages have had their access changed since they were indexed. It was designed to catch the pages which have a start/stop date.

But that is not quite sufficient.

Problems:
1) If a page is indexed and then later it's access rules are changed the page and it;s artefacts/blocks were not getting re-indexed to reflect the rule change

- need the add_to_queue_access() a check for view_access rows whose 'ctime' value is within the range being checked.

2) If a page did get found with the add_to_queue_access() function it was still ignoring the blocktype 'text' and so was not updating the view_access rules for that

- need to add a sql query to find these non-artefact items we want to index and them to the queue also

3) Deleting of all the view_access rules for a page was not being picked up and so items
were not being re-indexed

- need to add items to queue when all access rules are removed from a view
[this is not a problem if rules are changed as we delete all rules and add in new ones so can be picked up by change for (1) where we look for new access rules]

Robert Lyon (robertl-9)
Changed in mahara:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Robert Lyon (robertl-9)
milestone: none → 18.04.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8370
Committed: https://git.mahara.org/mahara/mahara/commit/f41ec4dbcd000b557ecbc07cff57d1ec9307af67
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit f41ec4dbcd000b557ecbc07cff57d1ec9307af67
Author: Robert Lyon <email address hidden>
Date: Tue Dec 19 10:37:02 2017 +1300

Bug 1738898: Elasticsearch not indexing access changes correctly

There is an add_to_queue_access() function that is meant to check what
pages have had their access changed since they were indexed. It was
designed to catch the pages which have a start/stop date.

But that is not quite sufficient.

See bug report for more info

behatnotneeded

Change-Id: I160d074fc709c7e94c9c4cacab8f2c5e6c7e9a86
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "16.10_STABLE" branch: https://reviews.mahara.org/8494

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "17.04_STABLE" branch: https://reviews.mahara.org/8495

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "17.10_STABLE" branch: https://reviews.mahara.org/8496

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8494
Committed: https://git.mahara.org/mahara/mahara/commit/db77468a284d51d6f77d5f4735e5bc9a3f3be643
Submitter: Robert Lyon (<email address hidden>)
Branch: 16.10_STABLE

commit db77468a284d51d6f77d5f4735e5bc9a3f3be643
Author: Robert Lyon <email address hidden>
Date: Tue Dec 19 10:37:02 2017 +1300

Bug 1738898: Elasticsearch not indexing access changes correctly

There is an add_to_queue_access() function that is meant to check what
pages have had their access changed since they were indexed. It was
designed to catch the pages which have a start/stop date.

But that is not quite sufficient.

See bug report for more info

behatnotneeded

Change-Id: I160d074fc709c7e94c9c4cacab8f2c5e6c7e9a86
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/8495
Committed: https://git.mahara.org/mahara/mahara/commit/acaaeabee3a5b9f718e0c825ba8aef400eab9cc0
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.04_STABLE

commit acaaeabee3a5b9f718e0c825ba8aef400eab9cc0
Author: Robert Lyon <email address hidden>
Date: Tue Dec 19 10:37:02 2017 +1300

Bug 1738898: Elasticsearch not indexing access changes correctly

There is an add_to_queue_access() function that is meant to check what
pages have had their access changed since they were indexed. It was
designed to catch the pages which have a start/stop date.

But that is not quite sufficient.

See bug report for more info

behatnotneeded

Change-Id: I160d074fc709c7e94c9c4cacab8f2c5e6c7e9a86
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/8496
Committed: https://git.mahara.org/mahara/mahara/commit/192fb0dbf0b96e51ab7d163edae3b096957a1499
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.10_STABLE

commit 192fb0dbf0b96e51ab7d163edae3b096957a1499
Author: Robert Lyon <email address hidden>
Date: Tue Dec 19 10:37:02 2017 +1300

Bug 1738898: Elasticsearch not indexing access changes correctly

There is an add_to_queue_access() function that is meant to check what
pages have had their access changed since they were indexed. It was
designed to catch the pages which have a start/stop date.

But that is not quite sufficient.

See bug report for more info

behatnotneeded

Change-Id: I160d074fc709c7e94c9c4cacab8f2c5e6c7e9a86
Signed-off-by: Robert Lyon <email address hidden>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.