Item13056: The FileAttachment table in the wiki database is not being updated in a timely manner

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: DBIStoreContrib
Branches: master
Reported By: CrawfordCurrie
Waiting For:
Last Change By: CrawfordCurrie
After deletion the record remains in the table. I've attached an image showing a the record of the attachment "TRAV-222 - DB Test.doc". This result was obtained after deleting the file. It appears that these ghost records remain until the topic is updated again...I can't remember whether another attachment has to be deleted for the ghost attachment disappears or whether it disappears after a new attachment.

Note that the update didn't have to occur on the same attachment name. It doesn't appear to be an issue of the attachment version, but rather it appears that the database refresh is happening before the topic is saved, or on a cached version of the topic. Maybe something like

Topic add attachment saved DB add attachment refresh DB remove attachment refresh Topic remove attachment saved

-- HerbHartshorne - 26 Aug 2014

FILEATTACHMENT meta removed from topic A , topic saved. When DBIStoreContrib is operating as a "true store" i.e. in Foswiki 1.2, then the DB is updated by this save and the FILEATTACHMENT disappears from A. However in 1.1.9 there is nowhere to attach a handler to, no DB update and the FILEATTACHMENT record remains in A.

File is physically moved from pub/AWeb/A to pub/BWeb/B

FILEATTACHMENT meta added to topic B, topic save. Again in 1.2 there's a DB update, so the new FILEATTACHMENT is put in place.

So, at the end of the move, everyone but the DB has been told. There is a handler call that's meant to fix things, but it doesn't actually remove the old file attachment. The next time A is edited, the FILEATTACHMENT will be deleted. The next time B is edited (Trash/TrashAttachment) then the attachment will appear there.

A DB rebuild will fix it, as will editing (or a db refresh) of the relevant topics.

The fix is to force a reload of both source and target topics from the text metadata

-- CrawfordCurrie - 3 Sep 2014

 
Topic revision: r4 - 28 Nov 2014, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy