[asterisk-bugs] [Asterisk 0017038]: Insert fails when database initialized during connection outage to postgres server

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Mar 16 13:06:02 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17038 
====================================================================== 
Reported By:                pk16208
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17038
Category:                   CDR/cdr_pgsql
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0.26 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-16 08:00 CDT
Last Modified:              2010-03-16 13:06 CDT
====================================================================== 
Summary:                    Insert fails when database initialized during
connection outage to postgres server
Description: 
When asterisk starts up or reload the cdr_pgsql does not work properly when
the database connection fails during startup.
These results in a empty server record list and no cdr's are logged and
reconnect does not resolve the problem

In the case of AST_RWLIST_EMPTY(&psql_columns) 
the databse connection has to be closed completely and a complete
reinitialization is necessery.
The following patch will do the job:

<inline patch removed by lmadsen>

====================================================================== 

---------------------------------------------------------------------- 
 (0119449) lmadsen (administrator) - 2010-03-16 13:06
 https://issues.asterisk.org/view.php?id=17038#c119449 
---------------------------------------------------------------------- 
Per russell on IRC, this issue is really an architectural deficiency in the
way the code is written, and is thus expected behaviour.

However, there is an experimental branch (based off of trunk, which will
eventually become Asterisk 1.8) that could potentially solve your issue.

The branch is available here: 
http://svn.asterisk.org/svn/asterisk/team/russell/cdr-q/

It implements a CDR queue so that when the database goes offline, the CDRs
will be queue'd, and then written when the database becomes available
next.

The reviewboard link is available here:

https://reviewboard.asterisk.org/r/531/ 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-03-16 13:06 lmadsen        Note Added: 0119449                          
======================================================================




More information about the asterisk-bugs mailing list