Yes, this is related to the same topic ID, and no, it is not a DDOS attack. We have verified this on the edge server, and there were no such activities at the time in question. Additionally, our provider did not notify us of any incidents.
From our analysis of the SHOW ENGINE INNODB STATUS output, it appears that the issue stems from resource contention, specifically competition for table access. This contention seems to cause the system to stall.
I am attaching a small excerpt from the output for reference:
MariaDB [psxekstrema]> SHOW ENGINE INNODB STATUS\G;
** 1. row **
Type: InnoDB
Name:
Status:
=====================================
2024-11-24 10:07:12 0x7fbc281fe700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 3 seconds
...
--Thread 140441241384704 has waited at btr0sea.cc line 956 for 0.00 seconds the semaphore:
S-lock on RW-latch at 0x55ea60016340 created in file btr0sea.cc line 240
...
Interestingly, this issue occurs sporadically without a clear pattern in timing or other consistent factors, but it does happen several times a day.
One of the queries being executed at the time is as follows:
SELECT forums_posts., author., author_pfields.*
FROM ibf_forums_posts AS forums_posts
LEFT JOIN ibf_core_members AS author ON author.member_id = forums_posts.author_id
LEFT JOIN ibf_core_pfields_content AS author_pfields ON author_pfields.member_id = author.member_id
WHERE forums_posts.topic_id = 111953
AND (forums_posts.queued IN(0,2))
ORDER BY post_date ASC
LIMIT 0,25;
Interestingly, when the system stabilizes, this same query executes relatively quickly, taking about 2 seconds.
Our question is whether there could be an issue with the query structure that affects index usage, particularly with this fragment:
forums_posts.queued IN(0,2).
Could this condition be causing the optimizer to avoid using indexes effectively?
We would appreciate your insights into whether there are structural improvements we could make to mitigate this issue.
Looking forward to your guidance.