phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] Followup and fix


From: Alex Borges
Subject: Re: [Phpgroupware-developers] Followup and fix
Date: 07 Aug 2003 00:02:21 -0500

I thinks this is why its going on:


>Aug  6 18:13:39 plain postgres[18842]: [12] LOG:  query: lock table
>phpgw_config in share mode

Share mode makes it so that the data cannot be concurrently changed i
think. The problem is that it doesnt conflict with itself, i think,
because we can see later.....


Aug  6 18:13:39 plain postgres[18838]: [62] LOG:  query: delete from
phpgw_config where config_name='mcrypt_mode'
Aug  6 18:13:39 plain postgres[18838]: [63] LOG:  query: insert into
phpgw_config (config_app,config_name,config_value) values
('phpgwapi','mcrypt_mode','cbc')
Aug  6 18:13:39 plain postgres[18838]: [64] LOG:  query: delete from
phpgw_config where config_name='file_repository'
Aug  6 18:13:39 plain postgres[18838]: [65] LOG:  query: insert into
phpgw_config (config_app,config_name,config_value) values
('phpgwapi','file_repository','sql')
Aug  6 18:13:39 plain postgres[18838]: [66] LOG:  query: delete from
phpgw_config where config_name='file_store_contents'
Aug  6 18:13:39 plain postgres[18838]: [67-1] LOG:  query: insert into
phpgw_config (config_app,config_name,config_value) values
Aug  6 18:13:39 plain postgres[18838]: [67-2] 
('phpgwapi','file_store_contents','filesystem')
Aug  6 18:13:39 plain postgres[18838]: [68] LOG:  query: delete from
phpgw_config where config_name='tz_offset'
Aug  6 18:13:39 plain postgres[18838]: [69] LOG:  query: insert into
phpgw_config (config_app,config_name,config_value) values
('phpgwapi','tz_offset','-5')
Aug  6 18:13:39 plain postgres[18838]: [70] LOG:  query: delete from
phpgw_config where config_name='asyncservice'
Aug  6 18:13:39 plain postgres[18838]: [71] LOG:  query: insert into
phpgw_config (config_app,config_name,config_value) values
('phpgwapi','asyncservice','off')
Aug  6 18:13:39 plain postgres[18838]: [72] LOG:  query: commit

Till here, we are OkAY, it has been commited. The problem i think is the
next one:

First, no begin here....

Aug  6 18:13:39 plain postgres[18839]: [13] LOG:  query: lock table
phpgw_app_sessions in share mode
Aug  6 18:13:39 plain postgres[18839]: [14] LOG:  query: delete from
phpgw_config where config_app='phpgwapi'

HERE..... it lets you lock it!

SHARED locks are not self exclusive, this means that two transactions
can lock the same table, hence the deadlock at the end


Aug  6 18:13:39 plain postgres[18840]: [13] LOG:  query: lock table
phpgw_app_sessions in share mode
Aug  6 18:13:39 plain postgres[18840]: [14] LOG:  query: delete from
phpgw_config where config_app='phpgwapi'
Aug  6 18:13:39 plain postgres[18840]: [15] ERROR:  deadlock detected

Aha, a deadlock it causes you....


So, i looked into it and i found this code in db_pgsql:
           {
                                        while ($t = each($table))
                                        {
!                                               $result =
pg_Exec($this->Link_ID,'lock table ' . $t[1] . ' in share mode');
                                        }
                                }
                                else
                                {
!                                       $result =
pg_Exec($this->Link_ID, 'lock table ' . $table . ' in share mode');
                                }
                        }

Which is wrong, cause writes should be an exclusive share. I changed it
to this:

         {
                                        while ($t = each($table))
                                        {
!                                               $result =
pg_Exec($this->Link_ID,'lock table ' . $t[1] . ' in exclusive mode');
                                        }
                                }
                                else
                                {
!                                       $result =
pg_Exec($this->Link_ID, 'lock table ' . $table . ' in shared mode');
                                }
                        }


And it now works.... savanah patch is:1802

yay
 

El mi? 06-08-2003 a las 22:44, Alex Borges escribió:
> In doing performance testing on the thing (elza), im finding some ugly
> Deadlock Detected errors under postgres. Im just testing 100 users
> performing the login procedure until each user reaches home.php
> 
> This is postgres 7.3 . Stand by for more info.
> 
> 
> 
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/phpgroupware-developers
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]