Problem with database listing on 2017-03-19 14:50

All suggestions about TPFC should be posted here. Discussions about changes to TPFC will also be carried out here.
Post Reply
Message
Author
User avatar
Andrew Lee
Posts: 3052
Joined: Sat Feb 04, 2006 9:19 am
Contact:

Problem with database listing on 2017-03-19 14:50

#1 Post by Andrew Lee »

webfork alerted me to a problem yesterday whereby some old entries were surfacing in the front pages of the default listing.

After some investigation, I have nailed down to 80 entries being affected. There's a field called "display_order" in the database which is updated everytime the entry version string is changed (and the interval between this change and the last is >= 7 days). This field determines the order an entry appears in the listing.

For the affected 80 entries, all of them had their "display_order" changed to '2017-03-19 14:50:01'. This is very strange because another entry called "ver_updated", which is typically changed in tandom with "display_order", is not affected at all.

I have reverted all 80 entries from the db backup. So far, I have not been able to find out what's wrong from either the code or the web server log.

I am posting this for historical reference so that if ever we encounter this again, we can come back to this post.

I will keep trying to look through the code and try to identify any possible bug that might have caused this issue.

User avatar
SYSTEM
Posts: 2041
Joined: Sat Jul 31, 2010 1:19 am
Location: Helsinki, Finland

Re: Problem with database listing on 2017-03-19 14:50

#2 Post by SYSTEM »

This isn't even the first time when the glitch has occurred: https://www.portablefreeware.com/forums ... 137#p76137

It affected 78 entries last time. It looks like, whatever the bug is, when it does occur it hits about 80 entries. :|
My YouTube channel | Release date of my 13th playlist: August 24, 2020

User avatar
Andrew Lee
Posts: 3052
Joined: Sat Feb 04, 2006 9:19 am
Contact:

Re: Problem with database listing on 2017-03-19 14:50

#3 Post by Andrew Lee »

Thanks SYSTEM! So webfork was right that it happened about 2 years back, but I couldn't find the topic because it was buried in the "New designs for TPFC by tproli" thread.

Since the problem has recurred, I think it's good we have a dedicated topic for it. After re-reading the messages in 2015, I am surprised the symptoms and analysis are the same. I suspect this is caused by some kind of unidentified, rare, race condition in the code somewhere.

I need to think about how to deal with this, at the very least, put in additional logs so that if it occurs again, we have more info to work on next time.

If you guys have any idea or suggestions, do lemme know. Thanks!

User avatar
Andrew Lee
Posts: 3052
Joined: Sat Feb 04, 2006 9:19 am
Contact:

Re: Problem with database listing on 2017-03-19 14:50

#4 Post by Andrew Lee »

I have added additional checks to the database maintenance script to guard against more than one instance of the script being run at the same time.

Previously, it was assumed that the maintenance script will finish within the allotted 5 mins. If the system is under heavy load, this might not be the case, and another instance of the script might be spawned, leading to unforeseen behaviour.

Post Reply