Asterisk
  1. Asterisk
  2. ASTERISK-4784

[patch] [post 1.2] Added support to cdr_pgsql.c to spool queries when lost database connection

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: CDR/cdr_pgsql
    • Labels:
      None
    • Mantis ID:
      4909
    • Regression:
      No

      Description

      Added a "spool file" to cdr_pgsql.conf:

      spool=pgsql.spool

      When the connection to the database is lost or an error occurs to a query, it will write the query to /var/log/asterisk/pgsql.spool . When the connection comes back up, it will read all the querys written and execute them, then delete the file.

        Activity

        Hide
        Corey Frang added a comment -

        cdr_pgsql.c.txt is the proper version of the patch file, sorry about the first one

        Show
        Corey Frang added a comment - cdr_pgsql.c.txt is the proper version of the patch file, sorry about the first one
        Hide
        Corey Frang added a comment -

        I faxed in my disclaimer, in case your going to merge this into head.

        Show
        Corey Frang added a comment - I faxed in my disclaimer, in case your going to merge this into head.
        Hide
        drmac added a comment -

        I believe the cdr module in general now supports spooling. There is another patch on mantis to add this support to cdr_mysql. Perhaps it would be better to generalize this spooling into cdr.c instead of each doing their own thing.

        Show
        drmac added a comment - I believe the cdr module in general now supports spooling. There is another patch on mantis to add this support to cdr_mysql. Perhaps it would be better to generalize this spooling into cdr.c instead of each doing their own thing.
        Hide
        Kevin P. Fleming (Inactive) added a comment -

        The CDR core already supports batching and background posting. I see no need to provide additional spooling support in the CDR driver modules themselves.

        Show
        Kevin P. Fleming (Inactive) added a comment - The CDR core already supports batching and background posting. I see no need to provide additional spooling support in the CDR driver modules themselves.
        Hide
        Michael Jerris added a comment -

        Is there a reason this is still open if we are planning on using the cdr core spooling going forward? Does this add any value that is not in the cdr core spooling funtionality?

        Show
        Michael Jerris added a comment - Is there a reason this is still open if we are planning on using the cdr core spooling going forward? Does this add any value that is not in the cdr core spooling funtionality?
        Hide
        cmaj added a comment -

        When the DB connection dies, the background post will fail just like a regular post. Sleeping the posting thread on failure from backend modules would chew up memory and still not help when asterisk terminates unexpectedly.

        Perhaps make this patch generic by including a priority for CDR modules via a list in cdr.conf ? Then make the default failure to cdr_csv in all cases.

        Show
        cmaj added a comment - When the DB connection dies, the background post will fail just like a regular post. Sleeping the posting thread on failure from backend modules would chew up memory and still not help when asterisk terminates unexpectedly. Perhaps make this patch generic by including a priority for CDR modules via a list in cdr.conf ? Then make the default failure to cdr_csv in all cases.
        Hide
        Tilghman Lesher added a comment -

        Core spooling supercedes. Closed.

        Show
        Tilghman Lesher added a comment - Core spooling supercedes. Closed.

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development