Support Forum

Problem Adding Member to User Group (database lockup)

SP sptab
sptab
Member

It’s been a while I am experiencing a problem when adding a member to a user group, I am getting the wait box below showing forever…

This happens in SP Administration, when going to Users Groups / Manage User Groups, in one of my User Groups. I can show the existing members with “Show/Hide Members” button. The problem comes when I press the “Add Members” button, the wait box shows and seems to run forever.

So far, I found in my mysql server logs that this operation creates the following query:

(extract)

SELECT wp_sfmembers.user_id, display_name, admin

FROM wp_sfmembers

WHERE user_id NOT

IN (

SEL….

 

which goes in “Sending data” for a very long time. I never let it timeout, since it’s locking all my other forum queries and I have to kill it manually.

My forum/Wordpress setup has ~80 000 users, the User Group I want to add members on contains just 5 users.

What could be the problem cause, is there a quick fix ?

Thank you.

18 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

let me take a look and come back on this…

SP sptab
sptab
Member

I am up for it if the change scope is expected to be limited to the member adding feature. 

My forum is live, I have no staging or pre-production instance and I’d really don’t want to break anything kiss

Cheers.

YS Yellow Swordfish
Yellow Swordfish
Member

Yes that would have been the case but I am going to need to investigate further.

I think the current query there is probably inefficient but constructing an alternative may not be quite as straightforward as I first thought. So – still looking into it but not necessarily an instant fix…

SP sptab
sptab
Member

Ok, I’ll wait.

In the meantime, if you have an SQL tip so I can do the operation by hand, manually adding a user_id to a group_id (wp_sfgroups) ?

 

Thank you.

 

YS Yellow Swordfish
Yellow Swordfish
Member

Well that is held relationally in the ‘sfmemberships’ table which holds the user_id and the usergroup_id combinations… So quite easy to manually adjust and add rows to.

SP sptab
sptab
Member

Thanks, that does the job for the moment, but I’ll be fine to test any fix you will provide.

Cheers.

YS Yellow Swordfish
Yellow Swordfish
Member

I have opened a ticket. I need to get some test data re-arranged so that I can test things a little more reliably.

SP sptab
sptab
Member

I believe the issue mentionned in that post was marked as fixed in Mantis bugtracker, but can’t find it again.

I have recently updated Simple Press to latest version 5.3, hoping to get the database lockup issue would be gone, unfortunately the problem is still there frown

YS Yellow Swordfish
Yellow Swordfish
Member

Yes indeed I rewrote the query and the routines involved which took the load off of the query and mySQL and my tests and profiling suggest it is now perfectly efficient. Maybe your issue is more to do with the AJAX functionality surrounding the add members form. Are you seeing any reported issues in the  script console when you run it?

SP sptab
sptab
Member

I believe the problem is still DB related as I got a long running query after listing the members from a user group.

As this locks the whole forum, I did not leave the query blocking for long time and killed it after a minute or so. 

YS Yellow Swordfish
Yellow Swordfish
Member

How are you determining you have a ‘long running query’ please? What are you using?

SP sptab
sptab
Member

Well, queries even the most complex ones in SP seem to execute in less than a second on my server.

In the case of this problem here, I just do mysqladmin -p processlist from the shell and watch the value in the time column grow for the line of the query I believe is related to the User group action.

 

YS Yellow Swordfish
Yellow Swordfish
Member

So – just lets confirm things. The action we are talking about here in the initial query that runs in the user group management panels when you use the ‘Add Members’ tool. Is that right?

And if so – can we also assume your site is set up to allow a user to be in more than a single user group?