View Issue Details

IDProjectCategoryView StatusLast Update
0000149pgpoolAdminBugpublic2015-10-14 11:56
ReportergcloughAssigned Toanzai 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOSOracle LinuxOS Version7.6
Product Version 
Target VersionFixed in Version3.3 
Summary0000149: Incorrect error for "Watchdog" command failures
DescriptionI'm setting up a new system, and everything works except for the "Watchdog" button. During diagnosis of what's wrong I think I've discovered that the error thrown during a pcp_watchdog command failure is a duplicate of the pcp_node_info error:

status.php: (This is the file that's called by the browser)
  case 'watchdog':
    $viewPHP = 'innerWatchdog.php';
  break;


innerWatchdog.php: (This is called by status.php above)
  $watchdogInfo['local'] = getWatchdogInfo();


command.php: (This is called by innerWatchdog.php above)
/** Get the watchdog information of thet specified other pgpool
 * If $i is omitted one's own watchdog information is returned.
 */
function getWatchdogInfo($i = '')
{
    global $tpl;


    $result = execPcp('PCP_WATCHDOG_INFO', $i);

    if (!array_key_exists('SUCCESS', $result)) {
        $errorCode = 'e1003';
        $tpl->assign('errorCode', $errorCode);
        $tpl->display('innerError.tpl');
        exit();
    }

    $arr = explode(" ", $result['SUCCESS']);
    $rtn['hostname'] = $arr[0];
    $rtn['pgpool_port'] = $arr[1];
    $rtn['wd_port'] = $arr[2];
    $rtn['status'] = $arr[3];

    return $rtn;
}


The documentation here doesn't have an error code for the PCP_WATCHDOG_INFO command failing, so I guess the e1003 code that refers to PCP_NODE_INFO was used:

http://www.pgpool.net/docs/pgpoolAdmin/en/errorCode.html


HOW TO FIX:

1. Update the documentation and allocate a code for PCP_WATCHDOG_INFO
2. Update command.php to use this new error, so that when PCP_WATCHDOG_INFO is failing, you get a relevant error

Steps To Reproduce1. Click on the "pgpool Status" button in the top-left
2. Click on the "Watchdog" button underneath "Backend info (PostgreSQL)"
3. Note the error does not relate to Watchdog:

Error Code e1003
Error Message pcp_node_info command error occurred.
TagsNo tags attached.

Activities

Issue History

Date Modified Username Field Change
2015-10-12 21:05 gclough New Issue
2015-10-13 16:36 t-ishii Assigned To => anzai
2015-10-13 16:36 t-ishii Status new => assigned
2015-10-14 11:56 anzai Note Added: 0000587
2015-10-14 11:56 anzai Status assigned => resolved
2015-10-14 11:56 anzai Fixed in Version => 3.3
2015-10-14 11:56 anzai Resolution open => fixed