1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838
|
Release Notes
===============================================================================
3.6 Series (201x/xx/xx - )
===============================================================================
3.6.0 (subaruboshi) 201x/xx/xx
* Version 3.6.0
This is the first version of pgpool-II 3.6 series.
That is, a "major version up" from 3.5 series.
* Overview
Major enhancements in Pgpool-II 3.6 include:
- Improve the behavior of fail-over. In the steaming replication mode,
client sessions will not be disconnected when a fail-over occurs any
more if the session does not use the failed standby server. If the
primary server goes down, still all sessions will be disconnected.
Also it is possible to connect to Pgpool-II even if it is doing health
checking retries. Before all attempt of connecting to Pgpool-II failed
while doing health checking retries.
- New PGPOOL SET command has been introduced. Certain configuration
parameters now can be changed on the fly in a session.
- Watchdog is significantly enhanced. It becomes more reliable than
previous releases.
- Handling of extended query protocol (e.g. used by Java applications)
in streaming replication mode speeds up if many rows are returned
in a result set.
- Import parser of PostgreSQL 9.6.
- In some cases pg_terminate_backend() now does not trigger a fail-over.
- Change documentation format from raw HTML to SGML.
The above items are explained in more detail in the sections below.
* Major Enhancements
- Improve the behavior of fail-over. (Tatsuo Ishii)
In the steaming replication mode, client sessions will not be
disconnected when a fail-over occurs any more if the session
does not use the failed standby server. If the primary server
goes down, still all sessions will be disconnected. Health check
timeout case will also cause the full session disconnection.
Other health check error, including retry over case does not
trigger full session disconnection.
For user's convenience, "show pool_nodes" command shows the session
local load balance node info since this is important for users in
case of fail-over. If the load balance node is not the failed node,
the session will not be affected by fail-over.
Also now it is possible to connect to Pgpool-II even if it is doing
health checking retries. Before all attempt of connecting to Pgpool-II
failed while doing health checking retries. Before any attempt to
connect to Pgpool-II fails if it is doing a health check against
failed node even if fail_over_on_backend_error is off because Pgpool-II
child first tries to connect to all backend including the failed one and
exits if it fails to connect to a backend (of course it fails). This is
a temporary situation and will be resolved before pgpool executes fail-over.
However if the health check is retrying, the temporary situation keeps longer
depending on the setting of health_check_max_retries and health_check_retry_
delay. This is not good. Attached patch tries to mitigate the problem:
When an attempt to connect to backend fails, give up connecting to
the failed node and skip to other node, rather than exiting the process
if operating in streaming replication mode and the node is not primary node.
Mark the local status of the failed node to "down". This will let the primary
node be selected as a load balance node and every queries will be sent to the
primary node. If there's other healthy standby nodes, one of them will be
chosen as the load balance node.
After the session is over, the child process will suicide to not retain
the local status.
- Add PGPOOL SHOW, PGPOOL SET and PGPOOL RESET commands. (Muhammad Usama)
These are similar to the PostgreSQL's SET and SHOW commands for GUC
variables, adding the functionality in Pgpool-II to set and reset
the value of config parameters for the current session, and for
that it adds a new syntax in Pgpool-II which is similar to PostgreSQL's
SET and RESET variable syntax with an addition of PGPOOL keyword at the start.
Currently supported configuration parameters by PGPOOL SHOW/SET/RESET are:
log_statement, log_per_node_statement, check_temp_table, check_unlogged_
table, allow_sql_comments, client_idle_limit, log_error_verbosity,
client_min_messages, log_min_messages, client_idle_limit_in_recovery.
- Sync inconsistent status of PostgreSQL nodes in Pgpool-II instances
after restart. (Muhammad Usama)
- At the Pgpool-II startup, the status of each configured backend node
is loaded from the backend status file or otherwise initialized by
querying the backend nodes. This technique works fine in stand alone mode
and also with the watchdog enabled as long as the status of backend nodes
remains consistent until all Pgpool-II nodes got up and running. But since
Pgpool-II does not sync the backend node status from the watchdog cluster
at startup time, so in some cases the Pgpool-II nodes participating in the
watchdog cluster may get a different status for the same backend,
especially if the Pgpool-II nodes part of the watchdog cluster starts
at different times and between that time an unavailable backend
PostgreSQL node had become available again.
So to solve this, the commit implements the new startup procedure
for the standby Pgpool-II, And now the standby Pgpool-II will load the
backend status of all configured PostgreSQL nodes from the watchdog
master/coordinator node at the time of startup.
- Enhance performance of SELECT when lots of rows involved. (Tatsuo Ishii)
Pgpool-II flushes data to network (calling write(2)) every time it
sends a row data ("Data Row" message) to frontend. For example, if 10,000
rows needed to be transfer, 10,000 times write()s are issued. This is
pretty expensive. Since after repeating to send row data, "Command Complete"
message is sent, it's enough to issue a write() with the command complete
message. Also there are unnecessary flushing are in handling the command
complete message.
Quick testing showed that from 47% to 62% performance enhancements
were achieved in some cases.
Unfortunately, performance in workloads where transferring few rows,
will not be enhanced since such rows are needed to flush to network anyway.
- Import PostgreSQL 9.6's SQL parser. (Bo Peng)
This allows Pgpool-II to fully understand the newly added SQL syntax
such as COPY INSERT RETURNING.
- In some cases pg_terminate_backend() now does not trigger a fail-over. (Muhammad Usama)
Since the pg_terminate_backend function in PostgreSQL is used to terminate
the backend connection, So what happens is, when this function kills a PostgreSQL
backend that is connected to the Pgpool-II, This disconnection of backend by
pg_terminate_backend function is appeared as a backend node failure to the
Pgpool-II. But the problem here is, PostgreSQL does not give any information
to the client program that the connection is going to be killed because of
the pg_terminate_backend call and on the client side, it looks similar to
the backend node failure.
Now to solve this in Pgpool-II we need two things. First is to
identify the pg_terminate_backend function in the query and the
Pgpool-II child process that hosts the particular backend connection
which will be killed by that pg_terminate_backend function call,
so that we get a heads up in advance about the backend termination,
and secondly the routing of the query containing pg_terminate_backend
also needs a new logic so that the query should be sent to the correct
PostgreSQL node that hosts the backend with the PID referred by
the pg_terminate_backend()
So how does this commit handles pg_terminate_backend()??
In the SimpleQuery() function which is the work horse of simple query
processing in the Pgpool-II we start with the search of the
pg_terminate_backend() function call in the query parse tree and if
the search comes out to be successful, the next step is to locate
the Pgpool-II child process and a backend node of that connection
whose PID is specified in pg_terminate_backend function's argument.
Once the connection and the Pgpool-II child process is identified,
we just set the swallow_termination flag(added by this commit in
ConnectionInfo structure) for that connection in the shared memory,
and also set the query destination node to the backend node that
hosts that particular connection and does not call pool_where_to_send()
for this query so that the query should be sent to the correct
backend node.
Now when the query is routed to the correct node and consequently
the backend gets killed, that results in the communication error on
Pgpool-II side, the Pgpool-II already knows that this disconnection
is due the pg_terminate_backend and not because of node failure as
the swallow_termination flag is already set for the connection.
Some works are still remaining.
pg_terminate_backend is not handled with extended query protocol.
Currently we only support pg_terminate_backend(constant number)
function calls. If the expression or sub query is used in the
argument of pg_terminate_backend then it would not be handled e.g
pgpool=# select pg_terminate_backend(1025); -- Supported
pgpool=# select pg_terminate_backend( 2 +1); -- NOT SUPPORTED
pgpool=# select pg_terminate_backend((select 1)); -- NOT SUPPORTED
Currently only one pg_terminate_backend call in a query is handled.
- HTML documents are now generated from SGML documents.
(Muhammad Usama, Tatsuo Ishii, Bo Peng)
It is intended to have better construction, contents and
maintainability. However, still there's tremendous room to
enhance the SGML documents. Please help us!
* Other Enhancements
- Make authentication error message more user friendly. (Tatsuo Ishii)
When attempt to connect to backend (including health checking),
emit error messages from backend something like "sorry,
too many clients already" instead of "invalid authentication
message response type, Expecting 'R' and received '%c'"
- Tighten up health check timer expired condition in pool_check_fd().
(Muhammad Usama)
Check if the signal was actually the health check timer expire to
make sure that we do not declare the timer expire due to some other
signal arrived while waiting for data for health check in pool_check_fd().
- Add new script called "watchdog_setup". (Tatsuo Ishii)
watchdog_setup is a command to create a temporary installation
of Pgpool-II clusters with watchdog for mainly testings.
Add "-pg" option to pgpool_setup. (Tatsuo Ishii)
This is useful when you want to assign specific port numbers to
PostgreSQL while using pgpool_setup. Also now pgpool_setup is
installed in the standard bin directory which is same as pgpool.
- Add "replication delay" column to "show pool_nodes". (Tatsuo Ishii)
This column shows the replication delay value in bytes if operated
in streaming replication mode.
- Do not update status file if all backend nodes are in down
status. (Chris Pacejo, Tatsuo Ishii)
This commit tries to remove the data inconsistency in replication
mode found in [pgpool-general: 3918] by not recording the status file
when all backend nodes are in down status. This surprisingly simple
but smart solution was provided by Chris Pacejo.
- Allow to use multiple SSL cipher protocols. (Multiple Usama)
By replacing TLSv1_method() with SSLv23_method() while initializing
the SSL session, we can use more protocols than TLSv1 protocol.
Allow to use arbitrary number of items in the
black_function_list/white_function_list. (Muhammad Usama)
Previously there were fixed limits for those.
- Properly process empty queries (all comments). (Tatsuo Ishii)
Pgpool-II now recognizes an empty query consisted of all comments
(for example "/* DBD::Pg ping test v3.5.3 */") (note that no ';')
as an empty query.
Before such that query was recognized an error.
Add some warning messages for wd_authkey hash calculation
failure. (Yugo Nagata)
Sometimes wd_authkey calculation fails for some reason other
than authkey mismatch. The additional messages make these distinguishable
for each other.
* Changes
- Change the default value of search_primary_node_timeout from 10 to
300. (Tatsuo Ishii)
Prior default value 10 seconds is sometimes too short for a standby
to be promoted.
- Change the Makefile under directory src/sql/, that is proposed by
[pgpool-hackers: 1611]. (Bo Peng)
- Change the PID length of pcp_proc_count command output to 6
characters long. (Bo Peng)
If the Pgpool-II process ID are over 5 characters, the 6th character
of each process ID will be removed. This commit changes the process ID
length of pcp_proc_count command output to 6 characters long.
- Redirect all user queries to primary server. (Tatsuo Ishii)
Up to now some user queries are sent to other than the primary
server even if load_balance_mode = off. This commit changes the
behavior: if load_balance_mode = off in streaming replication mode,
now all the user queries are sent to the primary server only.
* Bug fixes
- Fix the case when all backends are down then 1 node attached. (Tatsuo Ishii)
When all backends are down, no connection is accepted. Then 1
PostgreSQL becomes up, and attach the node using pcp_attach_node.
It successfully finishes. However, when a new connection arrives,
still the connection is refused becausePgpool-II child process
looks into the cached status, in which the recovered node is
still in down status if mode is streaming replication mode
(native replication and other modes are fine). Solution is,
if all nodes are down, force to restart all pgpool child.
- Fix for avoiding downtime when Pgpool-II changes require a
restart. (Muhammad Usama)
To fix this, The verification mechanism of configuration
parameter values is reversed, previously the standby nodes used
to verify their parameter values against the respective values
on the master Pgpool-II node and when the inconsistency was
found the FATAL error was thrown, now with this commit the
verification responsibility is delegated to the master Pgpool-II
node. Now the master node will verify the configuration parameter
values of each joining standby node against its local values and
will produce a WARNING message instead of an error in case of a
difference. This way the nodes having the different configurations
will also be allowed to join the watchdog cluster and the user
has to manually look out for the configuration inconsistency
warnings in the master Pgpool-II log to avoid the surprises at
the time of Pgpool-II master switch over.
- Fix a problem with the watchdog failover_command locking mechanism. (Muhammad Usama)
From Pgpool-II 3.5 watchdog was using the separate individual
locks for each node-failover command (failover, failback and follow-master)
and the lock was acquired just before executing the respective failover
script and was released as soon as the script execution finishes.
This technique although was very efficient but also had a problem.
If the failover_command takes a very little time and gets finished
before the lock request from other Pgpool-II node arrives, the other
node is also granted a lock, since the lock was already released by
the first node at that time. Consequently, both nodes ends up executing
the failover script. So to fix this we are reverting back to the tested
failover interlocking design used prior to Pgpool-II 3.5 where all the
commands gets locked at the failover start by the node that becomes a
lock-holder and each command lock is released after its execution
finishes. And only the lock-holder node is allowed to acquire/release
the individual command lock. That way the lock-holder node keeps the
lock-holder status throughout the span of the failover execution and
the system becomes less time sensitive.
- Disable strict aliasing optimization. (Tatsuo Ishii)
flatten_set_variable_args() was imported from PostgreSQL in Pgpool-II 3.5.
To make the code work, a compiler flag -fno-strict-aliasing is necessary
(PostgreSQL does so). Unfortunately when the function was imported, the
compiler flag was not added. To fix this, configure.ac was modified.
- Do not use random() while generating MD5 salt. (Tatsuo Ishii)
random() should not be used in security related applications.
To replace random(), import PostmasterRandom() from PostgreSQL.
Also store current time at the start up of Pgpool-II main process
for later use.
- Don't ignore sync message from frontend when query cache is enabled. (Tatsuo Ishii)
While returning cached query result, sync message sent from frontend
is discarded. This is harmless because "ready for query" messages is
sent to frontend afterward. Problem is, AccessShareLock held by previous
parse message processing is not released until sync message is received
by the backend. Fix is, forwarding the sync message to backend and discarding
"ready for query" message returned from backend.
- Fix bug that Pgpool-II fails to start if listen_addresses is
empty string. (bug 237) (Muhammad Usama)
The socket descriptor array (fds[]) was not getting the array
end marker when TCP listen addresses are not used.
- Create regression log directory if it does not exist yet. (Tatsuo Ishii)
- Fixing the error messages when the socket operation fails. (Muhammad Usama)
When some socket operation fails, we issue close socket before throwing
an error which causes the errno value to be overwritten and consequently
the error log does not print the correct failure reason. The solution is
to save the errno before closing the socket and use the saved value to
print error description.
- Fix regression failure of 003.failover. (Tatsuo Ishii)
Update expected data to reflect the changes made to show pool_nodes.
Also fix show pool_nodes to proper use "_" instead of space for the
column name.
- Fix hang when portal suspend received. (bug 230) (Tatsuo Ishii)
When portal suspend message is received, it's not enough to forward it
to the client. Since backend expects to receive execute message, trying
to read further more messages from backend will never succeed.
To fix this, turn off the query in progress flag, which will pole
incoming message from the client.
- Fix pgpool doesn't de-escalate IP in case network restored. (bug 228) (Muhammad Usama)
set_state function is made to de-escalate, when it is changing the
local node's state from the coordinator state to some other state.
- SIGUSR1 signal handler should be installed before watchdog
initialization. (Muhammad Usama)
Since there can be a case where a failover request from other
watchdog nodes arrive at the same time when the watchdog has just
been initialized, and if we wait any longer to install a SIGUSR1
signal handler, it can result in a potential crash
- Fix for bug of inconsistent status of PostgreSQL nodes in
Pgpool-II instances after restart. (bug 218) (Muhammad Usama)
Watchdog does not synchronize status. Currently at the Pgpool-II
startup, The status of each configured backend node is loaded from the
backend status file or otherwise initialized by querying the backend
nodes. This technique works fine in stand alone mode and also with
the watchdog enabled as long as the status of backend nodes remains
consistent until all Pgpool-II nodes got up and running. But since
Pgpool-II does not sync the backend node status from the watchdog
cluster at startup time, so in some cases the pgpool-II nodes
participating in the watchdog cluster may get a different status
for the same backend, especially if the Pgpool-II nodes part of
the watchdog cluster starts at different times and between that
time an unavailable backend PostgreSQL node had become available
again.
So to solve this, the commit implements the new startup procedure
for the standby Pgpool-II, And now the standby Pgpool-II will
load the backend status of all configured PostgreSQL nodes from
the watchdog master/coordinator node at the time of startup.
- Fix Pgpool-II doesn't escalate ip in case of another node
unavailability. (bug 215) (Muhammad Usama)
The heartbeat receiver fails to identify the heartbeat sender watchdog
node when the heartbeat destination is specified in terms of an IP address
while wd_hostname is configured as a hostname string or vice versa.
- Fixing a coding mistake in watchdog code. (Muhammad Usama)
wd_issue_failover_lock_command() function is supposed to forward
command type passed in as an argument to the wd_send_failover_sync_command()
function instead it was passing the NODE_FAILBACK_CMD command type.
The commit also contains some log message enhancements.
- Display human readable output for backend node status. (Muhammad Usama)
Changed the output of pcp_node_info utility and show commands display
human readable backend status string instead of internal status code.
- Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii)
The macro calls pool_virtual_master_db_node_id() and then access
backend->slots[id]->con using the node id returned. In rare cases,
it could point to 0 (in case when the DB node is not connected),
which gives access to con->major, then it causes a segfault.
- Fix "kind mismatch" error message in Pgpool-II. (Muhammad Usama)
Many of "kind mismatch..." errors are caused by notice/warning messages
produced by one or more of the DB nodes. In this case now Pgpool-II forwards
the messages to frontend, rather than throwing the "kind mismatch..." error.
This would reduce the chance of "kind mismatch..." errors.
- Fix handling of pcp_listen_addresses config parameter. (Muhammad Usama)
- Save and restore errno in each signal handler. (Tatsuo Ishii)
- Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii)
When child process dies, SIGCHLD signal is raised and wait(2) knows
the event. However, multiple child death does not necessarily creates exact
same number of SIGCHLD signal as the number of dead children and wait(2)
could wait for an event which never happens in this case. I Actually
encountered this situation while testing Pgpool-II. Solution is,
to use waitpid(2) instead of wait(2).
- Fix confusing error messages. (Tatsuo Ishii)
pool_read() does not emit error messages when read(2) returns -1
if fail_over_on_backend_error is off. In any case the cause of error
should be emitted. I do not back port this because it's a too trivial
enhancement.
- Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii)
While processing "show pool_nodes", the buffer for hostname was too short.
It should be same size as the buffer used for pgpool.conf. Problem reported
by a twitter user who is using pgpool on AWS (which could have very long hostname).
- Fix [pgpool-hackers: 1638] pgpool-II does not use default configuration. (Muhammad Usama)
Configuration file not found should just throw a WARNING message
instead of ERROR or FATAL.
- Fix bug with load balance node id info on shmem. (Tatsuo Ishii)
There are few places where the load balance node was mistakenly
put on wrong place. It should be placed on:
ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node].
In fact it was placed on:
*con_info[child id, connection pool_id, 0].load_balancing_node].
As long as the backend id in question is 0, it is ok. However while
testing Pgpool-II 3.6's enhancement regarding failover,
if primary node is 1 (which is the load balance node) and standby
is 0, a client connecting to node 1 is disconnected when failover
happens on node 0. This is unexpected and the bug was revealed.
It seems the bug was there since long time ago but it had
not found until today by the reason above.
- Fix for bug that pgpool hangs connections to database. (bug 197) (Muhammad Usama)
The client connection was getting stuck when backend node and
remote Pgpool-II node becomes unavailable at the same time.
The reason was a missing command timeout handling in the function
that sends the IPC commands to watchdog.
- Fix a possible hang during health checking. (bug 204) (Yugo Nagata)
Health checking was hang when any data wasn't sent from
backend after connect(2) succeeded. To fix this, pool_check_fd()
returns 1 when select(2) exits with EINTR due to SIGALRM while
health checking is performed.
- Deal with the case when the primary is not node 0 in streaming
replication mode. (Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that
if primary is not node 0, then statement timeout could occur even
after bug194-3.3.diff was applied. After some investigation,
it appeared that MASTER macro could return other than primary
or load balance node, which was not supposed to happen,
thus do_query() sends queries to wrong node (this is not clear
from the report but I confirmed it in my investigation).
pool_virtual_master_db_node_id(), which is called in MASTER macro
returns query_context->virtual_master_node_id if query context exists.
This could return wrong node if the variable has not been set yet.
To fix this, the function is modified: if the variable is not either
load balance node or primary node, the primary node id is returned.
For master and 3.5-stable, additional fixes/enhancements are made:
pool_extended_send_and_wait() now issues flush message if the request
is 'E' (execute).
Before it was issued outside (in Execute), but this makes the logic to
determine to which node the flush message to be sent unnecessary complex.
A debug message in pool_write is enhanced by adding backend node id.
- If statement timeout is enabled on backend and do_query() sends a query to
primary node, and all of following user queries are sent to standby,
it is possible that the next command, for example END, could cause a statement
timeout error on the primary, and a kind mismatch error on pgpool-II is
raised. (bug 194) (Tatsuo Ishii)
This fix tries to mitigate the problem by sending sync message instead of
flush message in do_query(), expecting that the sync message reset the
statement timeout timer if we are in an explicit transaction.
We cannot use this technique for implicit transaction case, because
the sync message removes the unnamed portal if there's any.
Plus, pg_stat_statement will no longer show the query issued
by do_query() as "running".
- Fix extended protocol handling in raw mode. (Tatsuo Ishii)
Bug152 reveals that extended protocol handling in raw mode
(actually other than in stream mode) was wrong in Describe()
and Close(). Unlike stream mode, they should wait for backend response.
- Fix confusing comments in pgpool.conf. (Tatsuo Ishii)
- Fix Japanese and Chinese documentation bug about raw mode. (Yugo Nagata, Bo Peng)
Connection pool is available in raw mode.
- Fix is_set_transaction_serializable() when
SET default_transaction_isolation TO 'serializable'. (bug 191) (Bo Peng)
SET default_transaction_isolation TO 'serializable' is sent to not only
primary but also to standby server in streaming replication mode,
and this causes an error. Fix is, in streaming replication mode,
SET default_transaction_isolation TO 'serializable' is sent only to
the primary server.
- Fix extended protocol hang with empty query. (bug 190) (Tatsuo Ishii)
The fixes related to extended protocol cases in 3.5.1 broke the case of
empty query. In this case backend replies with "empty query response"
which is same meaning as a command complete message. Problem is, when
empty query response is received, pgpool does not reset the query in progress
flag thus keeps on waiting for backend. However, backend will not send the
ready for query message until it receives a sync message. Fix is,
resetting the in progress flag after receiving the empty query response
and reads from frontend expecting it sends a sync message.
- Fix for [pgpool-general: 4569] Pgpool-II 3.5 : segfault. (Muhammad Usama)
PostgreSQL's memory and exception manager APIs adopted by the Pgpool-II 3.4
are not thread safe and are causing the segmentation fault in the watchdog
lifecheck process, as it uses the threads to ping configured trusted hosts for
checking the upstream connections. Fix is to remove threads and use the child
process approach instead.
- Validating the PCP packet length. (Muhammad Usama)
Without the validation check, a malformed PCP packet can crash the
PCP child and/or can run the server out of memory by sending the packet
with a very large data size.
- Fix Pgpool-II hang bug (bug 167). (Tatsuo Ishii)
Pgpool-II 3.5 or after in streaming replication mode does not
wait for response from each phase such parse, bind anymore.
However, if do_query is called, it sends flush message to retrieve
the result of system catalog look up. This is only sent to primary node
which may results in retrieving previous message results, for example
parse complete. If standby is assigned to load balance node, the node
does not return parse complete message, which will cause a problem
in bug167 case, because parse message for "BEGIN" was sent to both the
primary and the standby. Fix is, send flush message in do_query if the
load balance node is one of standbys.
- Fix pgpool_setup to not confuse log output. (Tatsuo Ishii)
Before it simply redirects the stdout and stderr of pgpool process
to a log file. This could cause log contents being garbled or even
missed because of race condition caused by multiple process being
writing concurrently. I and Usama found this while investigating
the regression failure of 004.watchdog. To fix this, pgpool_setup
now generates startall script so that pgpool now sends stdout/stderr
to cat command and cat writes to the log file (It seems the race
condition does not occur when writing to a pipe).
- Fix for [pgpool-general: 4519] Worker Processes Exit and
Are Not Re-spawned. (Muhammad Usama)
The problem was due to a logical mistake in the code for checking
the exiting child process type when the watchdog is enabled.
I have also changed the severity of the message from FATAL to LOG,
emitted for child exits due to max connection reached.
- Fix pgpool hung after receiving error state from backend. (bug #169) (Tatsuo Ishii)
This could happen if we execute an extended protocol query
and it fails. After an error is received the "ignore till sync flag"
is set and retained even if sync message was actually received.
Thus any subsequent query (in the case above "DEALLOCATE message")
is not processed and pgpool waits for message from frontend and backend,
and pgpool sticks here because no message will arrive from both side.
To fix this, unconditionally reset the "ignore till sync flag"
in ReadyforQuery(). This is safe because apparently we already
received the ready for query message.
- Fix query stack problems in extended protocol case. (bug 167, 168) (Tatsuo Ishii)
- Fix [pgpool-hackers: 1440] yet another reset query stuck problem. (Tatsuo Ishii)
After receiving X message from frontend, if Pgpool-II detects EOF
on the connection before sending reset query, Pgpool-II could wait for
backend which had not received the reset query. To fix this,
if EOF received, treat this as FRONTEND_ERROR, rather than ERROR.
- Fix for [pgpool-general: 4265] another reset query stuck problem. (Muhammad Usama)
The solution is to report FRONTEND_ERROR instead of simple ERROR
when pool_flush on front-end socket fails.
- Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6. (Muhammad Usama)
Incorporating the change of function signature for GetConfigOption()
functions in PostgreSQL 9.6
- Fix compile issue on freebsd. (Muhammad Usama)
Add missing include files. The patch is contributed by the bug
reporter and enhanced a little by me.
- Fix regression test to check timeout of each test. (Yugo Nagata)
- Add some warning messages for wd_authkey hash calculation failure. (Yugo Nagata)
Sometimes wd_authkey calculation fails for some reason other
than authkey mismatch. The additional messages make these distinguishable
for each other.
===============================================================================
3.5 Series (2016/01/29 - )
===============================================================================
3.5.4 (ekieboshi) 2016/08/31
* Version 3.5.4
This is a bugfix release against pgpool-II 3.5.3.
__________________________________________________________________
* Bug fixes
- Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii)
While processing "show pool_nodes", the buffer for hostname was too
short. It should be same size as the buffer used for pgpool.conf.
Problem reported by a twitter user who is using pgpool on AWS (which
could have very long hostname).
- Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii)
The usage of wait(2) in pgpool main could cause infinite wait in the
system call. Solution is, to use waitpid(2) instead of wait(2).
- Save and restore errno in each signal handler. (Tatsuo Ishii)
- Fix handling of pcp_listen_addresses config parameter. (Muhammad Usama)
- Fix "kind mismatch" error message in pgpool. (Muhammad Usama)
Many of "kind mismatch..." errors are caused by notice/warning
messages produced by one or more of the DB nodes. In this case now
Pgpool-II forwards the messages to frontend, rather than throwing the
"kind mismatch..." error. This would reduce the chance of "kind
mismatch..." errors.
See [pgpool-hackers: 1501] for more details.
- Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii)
The macro calls pool_virtual_master_db_node_id() and then access
backend->slots[id]->con using the node id returned. In rare cases, it
could point to 0 (in case when the DB node is not connected), which
gives access to con->major, then it causes a segfault.
See bug 225 for related info.
- Fixing a coding mistake in watchdog code. (Muhammad Usama)
wd_issue_failover_lock_command() function is supposed to forward command type
passed in as an argument to the wd_send_failover_sync_command() function instead
it was passing the NODE_FAILBACK_CMD command type.
The commit also contains some log message enhancements.
- doc : Fixing a typo in english doc (Muhammad Usama)
- Fix for bun 215 that pgpool doesn't escalate ip in case of another node unavailability.
(Muhammad Usama)
The heartbeat receiver fails to identify the heartbeat sender watchdog node when
the heartbeat destination is specified in terms of an IP address while
wd_hostname is configured as a hostname string or vice versa.
See bug 215 for related info.
- Fix for bug of inconsistent status of Postgresql nodes in Pgpool instances
after restart.(Muhammad Usama)
Watchdog does not synchronize status.
See bug 218 for related info.
- SIGUSR1 signal handler should be installed before watchdog initialization.
(Muhammad Usama)
Since there can be a case where a failover request from other watchdog nodes
arrive at the same time when the watchdog has just been initialized,
and if we wait any longer to install a SIGUSR1 signal handler, it can
result in a potential crash.
- Fix for bug 228 that pgpool doesn't de-escalate IP in case network restored.
(Muhammad Usama)
See bug 228 for related info.
- Fix hang when portal suspend received. (Tatsuo Ishii)
See bug 230 for related info.
- test : Add regression test for bug 230. (Tatsuo Ishii)
- Fixing a typo in the log message. (Muhammad Usama)
- Fixing the error messages when the socket operation fails. (Muhammad Usama)
- Tighten up health check timer expired condition in pool_check_fd(). (Muhammad Usama)
- doc : Add comment to the document about connection_cache. (Tatsuo Ishii)
- Fix Handling of pcp_socket_dir was missing from pool_get_config(). (Muhammad Usama)
- doc : Fix Japanese document typo. (Bo Peng)
- Fix "out of memory" by using "pg_md5 -m".(Muhammad Usama)
See bug 236 for related info.
- Fix for 237 that Pgpool-II fails to start if listen_addresses is empty string.
(Muhammad Usama)
The socket descriptor array (fds[]) was not getting the array end marker
when TCP listen addresses are not used.
See bug 237 for related info.
===============================================================================
3.5.3 (ekieboshi) 2016/06/17
* Version 3.5.3
This is a bugfix release against pgpool-II 3.5.2.
__________________________________________________________________
* New features
- Allow to access to pgpool while doing health checking (Tatsuo Ishii)
Currently any attempt to connect to pgpool fails if pgpool is doing
health check against failed node even if fail_over_on_backend_error is
off because pgpool child first tries to connect to all backend
including the failed one and exits if it fails to connect to a backend
(of course it fails). This is a temporary situation and will be
resolved before pgpool executes failover. However if the health check
is retrying, the temporary situation keeps longer depending on the
setting of health_check_max_retries and health_check_retry_delay. This
is not good. Attached patch tries to mitigate the problem:
- When an attempt to connect to backend fails, give up connecting to
the failed node and skip to other node, rather than exiting the
process if operating in streaming replication mode and the node is
not primary node.
- Mark the local status of the failed node to "down".
- This will let the primary node be selected as a load balance node
and every queries will be sent to the primary node. If there's other
healthy standby nodes, one of them will be chosen as the load
balance node.
- After the session is over, the child process will suicide to not
retain the local status.
Per [pgpool-hackers: 1531].
* Bug fixes
- Fix is_set_transaction_serializable() when
SET default_transaction_isolation TO 'serializable'. (Bo Peng)
SET default_transaction_isolation TO 'serializable' is sent to
not only primary but also to standby server in streaming replication mode,
and this causes an error. Fix is, in streaming replication mode,
SET default_transaction_isolation TO 'serializable' is sent only to the
primary server.
See bug 191 for related info.
- Fix Chinese documentation bug about raw mode (Yugo Nagata, Bo Peng)
Connection pool is available in raw mode.
- Fix confusing comments in pgpool.conf (Tatsuo Ishii)
- Fix extended protocol handling in raw mode (Tatsuo Ishii)
Bug152 reveals that extended protocol handling in raw mode (actually
other than in stream mode) was wrong in Describe() and Close().
Unlike stream mode, they should wait for backend response.
See bug 152 for related info.
- Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama)
Currently TLSv1_method() is used to initialize the SSL context, that puts an
unnecessary limitation to allow only TLSv1 protocol for SSL communication.
While postgreSQL supports other ciphers protocols as well. The commit changes
the above and initializes the SSLSession using the SSLv23_method()
(same is also used by PostgreSQL). Because it can negotiate the use of the
highest mutually supported protocol version and remove the limitation of one
specific protocol version.
- If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii)
query to primary node, and all of following user queries are sent to
standby, it is possible that the next command, for example END, could
cause a statement timeout error on the primary, and a kind mismatch
error on pgpool-II is raised.
This fix tries to mitigate the problem by sending sync message instead
of flush message in do_query(), expecting that the sync message reset
the statement timeout timer if we are in an explicit transaction. We
cannot use this technique for implicit transaction case, because the
sync message removes the unnamed portal if there's any.
Plus, pg_stat_statement will no longer show the query issued by
do_query() as "running".
See bug 194 for related info.
- Deal with the case when the primary is not node 0 in streaming replication mode.
(Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if
primary is not node 0, then statement timeout could occur even after
bug194-3.3.diff was applied. After some investigation, it appeared
that MASTER macro could return other than primary or load balance
node, which was not supposed to happen, thus do_query() sends queries
to wrong node (this is not clear from the report but I confirmed it in
my investigation).
pool_virtual_master_db_node_id(), which is called in MASTER macro
returns query_context->virtual_master_node_id if query context
exists. This could return wrong node if the variable has not been set
yet. To fix this, the function is modified: if the variable is not
either load balance node or primary node, the primary node id is
returned.
- Fix a possible hang during health checking (Yugo Nagata)
Health checking was hang when any data wasn't sent
from backend after connect(2) succeeded. To fix this,
pool_check_fd() returns 1 when select(2) exits with
EINTR due to SIGALRM while health checking is performed.
Reported and patch provided by harukat and some modification
by Yugo.
See bug 204 for related info.
- change the Makefile under this directory src/sql/,that is proposed by (Bo Peng)
[pgpool-hackers: 1611]
- fix for 0000197: pgpool hangs connections to database.. (Muhammad Usama)
The client connection was getting stuck when backend node and remote pgpool-II
node becomes unavailable at the same time. The reason was a missing command
timeout handling in the function that sends the IPC commands to watchdog.
- Fix bug with load balance node id info on shmem (Tatsuo Ishii)
There are few places where the load balance node was mistakenly put on
wrong place. It should be placed on:
ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node].
In fact it was placed on:
*con_info[child id, connection pool_id, 0].load_balancing_node].
As long as the backend id in question is 0, it is ok. However while
testing pgpool-II 3.6's enhancement regarding failover, if primary
node is 1 (which is the load balance node) and standby is 0, a client
connecting to node 1 is disconnected when failover happens on node
0. This is unexpected and the bug was revealed.
It seems the bug was there since long time ago but it had not found
until today by the reason above.
- Fixing coverity scan reported issues. (Muhammad Usama)
===============================================================================
3.5.2 (ekieboshi) 2016/04/26
* Version 3.5.2
This is a bugfix release against pgpool-II 3.5.1.
__________________________________________________________________
* Bug fixes
- Fix for segfault during trusted_servers check (Muhammad Usama)
PostgreSQL's memory and exception manager APIs adopted by the
pgpool 3.4 are not thread safe and are causing the segmentation fault
in the watchdog lifecheck process, as it uses the threads to ping
configured trusted hosts for checking the upstream connections.
Fix is to remove threads and use the child process approach instead.
See [pgpool-general: 4569] for more details.
- Removing the limit on the maximum number of items in the
black_function_list and white_function_list lists (Muhammad Usama)
extract_string_tokens in pool_config uses the fixed size malloc on
the array to hold the black_function_list/white_function_list items.
This imposes a limit of maximum items in these lists.
The fix is to use realloc to increase the array size when it gets full.
- Fix check "PCP Directory" in "Parameter Setting" in install
(Nozomi Anzai)
The command "pcp_system_info" was discarded in 3.5, but pgpoolAdmin
still confirmed if it existed.
Per bug #187.
- Fix extended protocol hang with empty query (Tatsuo Ishii)
The fixes related to extended protocol cases in 3.5.1 broke the case
of empty query. In this case backend replies with "empty query
response" which is same meaning as a command complete message. Problem
is, when empty query response is received, pgpool does not reset the
query in progress flag thus keeps on waiting for backend. However,
backend will not send the ready for query message until it receives a
sync message. Fix is, resetting the in progress flag after receiving
the empty query response and reads from frontend expecting it sends a
sync message.
Per bug #190.
- Redirect all user queries to primary server (Tatsuo Ishii)
Up to now some user queries are sent to other than the primary server
even if load_balance_mode = off. This commit changes the behavior: if
load_balance_mode = off in streaming replication mode, now all the
user queries are sent to the primary server only.
Per bug #189.
- Change the PID length of pcp_proc_count command result to 6 characters
long (Bo Peng)
If the pgpool process ID are over 5 characters, the 6th character of each
process ID will be removed. This commit changes the process ID length of
pcp_proc_count command result to 6 characters long.
Per bug #188.
===============================================================================
3.5.1 (ekieboshi) 2016/04/04
* Version 3.5.1
This is a bugfix release against pgpool-II 3.5.0.
__________________________________________________________________
* Bug fixes
- Add some warning messages for wd_authkey hash calculation failure
(Yugo Nagata)
Sometimes wd_authkey calculation fails for some reason other than
authkey mismatch. The additional messages make these distinguishable
for each other.
- test: Fix regression test to check timeout of each test (Yugo Nagata)
- test: Allow timeout value to be specified by the command option
(Yugo Nagata)
- Fix compile issue on FreeBSD (Muhammad Usama)
Added missing include files.
Per bug #166. The patch is contributed by the bug reporter and
enhanced a little by Usama.
- test: Fix test/regression/clean.sh to remove binary files of
010.rewrite_timestamp test (Yugo Nagata)
- Fix memory leak reported by Coverity (CID 1350095) (Yugo Nagata)
- Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6
(Muhammad Usama)
Incorporating the change of function signature for GetConfigOption..()
functions in PostgreSQL 9.6.
- Fix to properly process an empty query that has only comments
(Tatsuo Ishii)
Pgpool-II recognized an empty query, for example "/* DBD::Pg ping test
v3.5.3 */" (note that it has no ';') as an error and emits message
"Unable to parse the query". This is because raw_parser() cannot
distinguish an empty query from an error query due to the poor API
design. To fix this new out parameter "*error" added to the
function. If an error occurred, the variable is set to true and caller
can know the reason why raw_parser() returns NIL is because of an error
query or an empty query.
Per bug #154. See [pgpool-hackers: 1359] for additional information.
- Fix a reset query stuck problem (Muhammad Usama)
The solution is to report FRONTEND_ERROR instead of simple ERROR when
pool_flush on front-end socket fails.
The original report is
[pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL
The patch was generated by Usama and Pawel Ufnalewski<archon@foap.com>,
and Gerhard Wiesinger <lists@wiesinger.com> helped to verify and test
the fix.
- Fix a reset query stuck problem (Tatsuo Ishii)
After receiving X message from frontend, if pgpool-II detects EOF on
the connection before sending reset query, pgpool-II could wait for
a response from backend which had not received the reset query.
To fix this, if EOF received, treat this as FRONTEND_ERROR, rather
than ERROR.
See "[pgpool-hackers: 1440] Yet another reset query stuck problem"
for more details.
- Fix query stuck problems in streaming replication mode with extended
protocol queries (Tatsuo Ishii)
This fix is for both bug #167 and #168.
- Fix pgpool hung after receiving error state from backend (Tatsuo Ishii)
This could happened if we execute an extended protocol query and it
fails.
Per bug #169.
- Fix bug that child processes exit and are not re-spawned (Muhammad Usama)
The problem was due to a logical mistake in the code for checking the
exiting child process type when the watchdog is enabled. Also the severity
of the message emitted for child exits due to max connection reached
from FATAL to LOG.
Per [pgpool-general: 4519] Worker Processes Exit and Are Not Re-spawned
- Fix typo in configure (Tatsuo Ishii)
Patch provided by Thomas Munro.
- doc: Change description of backend_flag (Tatsuo Ishii)
It is pointed out that restarting pgpool-II is not necessary.
Per [pgpool-general-jp: 1394].
- doc: Fix installation procedure. (Tatsuo Ishii)
With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed.
- test: Fix pgpool_setup to not confuse log output (Tatsuo Ishii)
Before it simply redirects stdout and stderr of pgpool processes to
a log file. This could cause the log contents being garbled or even
missed because of race condition caused by multiple process being
writing concurrently.
To fix this, pgpool_setup now generates startall script in which pgpool
sends stdout/stderr to cat command by pipe, and cat writes to the log
file.
- Fix to validate the PCP packet length (Muhammad Usama)
Without the validation check, a malformed PCP packet can crash the
PCP child and/or can run the server out of memory by sending the packet
with a very large data size.
===============================================================================
3.5.0 (ekieboshi) 2016/01/29
* Version 3.5.0
This is the first version of pgpool-II 3.5 series.
That is, a "major version up" from 3.4 series.
__________________________________________________________________
* Incompatible changes
- Remove parallel query mode codes (Yugo Nagata)
There are very few users and the maintenance efforts are not worth it.
Codes for system db are also removed, since this was used in only parallel
query mode and old query cache on disk.
- Rename parameter name from ifconfig_path to if_cmd_path (Yugo Nagata)
ifconfig_path isn't appropriate for the parameter name because
ifconfig command is obsolete and now ip command is used as default.
- Change the syntax of pcp commands arguments (Muhammad Usama)
- Change the output and the argument semantics of pcp_watchdog_info command
(Muhammad Usama)
The command is enhanced to show watchdog information about all pgpool-II
nodes in the cluster. According to this, the argument to specify node index
is changed so that 0 means local pgpool-II node instead of the first remote
node.
__________________________________________________________________
* New features
- Add new parameter "serialize_accept" (Tatsuo Ishii)
This parameter defines whether to serialize accept() call for incoming
client connections. Default is off, which means no serializing (same
behavior as pgpool-II 3.4 or before). If this is off, the kernel
wakes up all of pgpool-II child process to execute accept() and one of
them actually accepts the incoming connection. Problem here is,
because so my child process wake up at a same time, heavy context
switching occurred and the performance is affected. This phenomena is
a classic problem called "the thundering herd problem". By enabling
serialize_accept, only one of pgpool-II child process is woken up and
executes accept() and the problem can be avoided.
- Import parser of PostgreSQL 9.5 (Yugo Nagata)
pgpool-II can understand new syntax introduced in PostgreSQL 9.5 now.
Especially GROUPING SET, CUBE, ROLLUP and TABLESAMPLE can be be load
balanced and can be used in query cache (except for TABLESAMPLE).
Also INSERT...ON CONFLICT and UPDATE tab SET (col1, col2, ...) =
(SELECT ...) ... can now be properly handled in query rewriting in
native replication mode.
- Allow to specify database for health check and streaming replication
delay check. (Tatsuo Ishii)
For this purpose new directive "health_check_database" and
"sr_check_database" are added.
__________________________________________________________________
* Enhancements
- Performance improvement in extended query protocol (Tatsuo Ishii)
Unnecessary "flush" messages which used to be sent in each step of
extended protocol messages (parse, bind, describe and execute) and
brought significant communication overhead are removed. For now it
only affects to streaming replication mode, that is, the performance
of other modes remains same.
- watchdog feature enhancements (Muhammad Usama, Yugo Nagata)
The goal of this enhancement is to address the shortcomings and problems
in the pgpool watchdog and make the watchdog system more robust and
adaptable. Patch created by Usama, and reviewed, tested, and debugged
by Yugo.
-- The watchdog should consider the quorum and only elect the master/leader
node if the quorum exist in the watchdog cluster.
-- All the participating pgpool-II nodes in the watchdog cluster should have
similar pgpool-II configurations.
-- Watchdog nodes should have configurable watchdog node priority, to give
users more control on which node should become a leader node.
-- More options for the node health-checking, especially watchdog should allow
external/3rd party node health checking system to integrate with it.
-- The watchdog should keep looking for problems like split-brain syndrome and
should automatically recover from it.
-- Allow user to provide scripts to be executed at time of escalation and
de-escalation to master/leader nodes.
Add these new parameters:
-- wd_ipc_socket_dir:
This parameter is used to specify the directory where the UNIX domain
socket accepting pgpool-II watchdog IPC connections will be created.
-- wd_priority:
This new parameter can be used to elevate the current watchdog node
priority in leader elections. The node with the higher wd_priority
value will get selected as master/coordinator watchdog node when
cluster will be electing its master node at cluster startup or in the
event of old master watchdog node failure.
-- wd_de_escalation_command:
This parameter holds the command that watchdog will execute on the
master pgpool-II watchdog node when that node resigns from the master
node responsibilities.
-- wd_monitoring_interfaces_list:
This parameter holds a comma separated list of network device names to
be monitored by the watchdog process for the network link state.
- Overhauling pcp commands (Muhammad Usama)
-- Improved handling of command argument:
Long command line options can be used now.
-- PCP password is safe:
Don't pass password via command line, which causes security risks.
-- Multiple concurrent execution of pcp commands:
Allow to execute a pcp command while running pcp_recovery_node
which takes sometime to finish.
- SELECT count statics in "show pool_nodes" command results (Tatsuo Ishii)
show pool_nodes results which briefly describes the status of each backend
now shows how many SELECTs are issued to them. So you can quickly
recognize the effect of load balancing for example;
test=# show pool_nodes;
node_id | hostname | port | status | lb_weight | role | select_cnt
---------+----------+-------+--------+-----------+---------+------------
0 | /tmp | 11002 | 2 | 0.500000 | primary | 338230
1 | /tmp | 11003 | 2 | 0.500000 | standby | 163939
(2 rows)
- Parser enhancements for query rewriting (Yugo Nagata)
INSERT/UPDATE/DELETE with WITH clause, writable CTE, RETURNING clause
can now be properly handled in query rewriting in native replication mode.
- Allow to open pool_passwd file in read only mode by pgpool-II main
process (Tatsuo Ishii)
- Allow to run pgpool in debug mode in regression tests (Tatsuo Ishii)
- doc:Add pgpool_adm documents (Tatsuo Ishii)
- doc:Update Chinese documents (Bambo Huang)
__________________________________________________________________
* Bug fixes (since 3.4.3)
- doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii)
In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent
to primary node only. Pointed out in [pgpool-general-jp: 1378].
- Issue fsync() when writing pgpool_status. (Tatsuo Ishii)
This ensures that pgpool_status is saved to permanent storage and
allow to survive after system crash.
- Fix reset query stuck problem (Muhammad Usama)
It is reported that reset query (DISCARD ALL etc.) occasionally does
not finish and pgpool child remain waiting for reply from the backend
thus client cannot connect to pgpool (for example bug report #107).
The cause of problem is not identified yet but if client suddenly
closes connection to pgpool in the middle of query processing, backend
may not accept the reset queries because they are not ready for query.
The fix is to keep track of the status of frontend socket state and not
caching the PostgreSQL connection if the connection to frontend was not
properly terminated.
- test: Fix false alarm of regression tset 062 (Yugo Nagata)
- test: Fix broken regression test for native replication (Yugo Nagata)
Test for insert-lock didn't work.
- test: Fix regress test to sleep after pgpool_reload (Yugo Nagata)
Some regression tests modify configuration file and reloads. However,
sometimes these were not applied to pgpool just after reloading.
- Fix inconsistency of sequence values in replication mode (Yugo Nagata)
When a schema name was provided, the table name was quoted wrongly as
like "public.mytbl" instead of "public"."mytbl". So, pool_regclass
and to_regclass couldn't find right table oid and insert lock was
never executed. This caused inconsistency between DB nodes.
- test: Fix complication error and segfault of timestamp rewrite test (Yugo Nagata)
- doc: Fix untranslated sentence in Japanese document (Yugo Nagata)
- Fix ancient bug of pool_push() and friends. (Tatsuo Ishii)
It allocates buffer using realloc and uses the pointer
returned. However it does the pointer calculation *before* realloc
gets called. So the calculation uses the old pointer value, which
causes various problems including segfault later.
Also there were other problems with it. The buffer pointer and buffer
size variable is not initialized. The buffer is not freed by
pool_close. Typo in debugging message (3.4 or later only). They are
fixed as well.
- doc: Fix wrong description in documents about log_standby_delay (Yugo Nagata)
- Fix segfault that occurs when function is used in FROM clause (Yugo Nagata)
PREPARE statements in streaming-reapplication mode and INSERT/UPDATE
with SELECT in native-replication mode were affected. For example:
- prepare p as select * from generate_series(1,1);
- insert into tbl select now(), * from generate_series(1,1);
- doc: Add caution about JDBC driver version regarding app_name_redirect_preference_list
(Tatsuo Ishii)
- Fix hang problem reported in bug #145. (Tatsuo Ishii)
The problem occurs when all the condition below are met:
1) pgpool-II 3.4 or later
2) streaming replication mode
3) primary node is also load balance node
4) extended protocol is used
5) client_idle_limit reached
- Fix a in-memory query cache bug (Tatsuo Ishii)
If extended query protocol is used and a bind/execute message arrives
which uses a statement created by prior parse message, the temp_cache
is not initialized by a parse messages. Thus messages are added to pre
existing temp cache buffer which causes the trouble, that is, when the
cached result returns, Data Row message and Command Complete message
appeared twice.
Per by bug #152.
- test: Fix regression test 065. (Tatsuo Ishii)
The path to JDBC driver was explicitly defined. This is wrong. This
should be inherited from JDBC_DRIVER environment variable.
- test: Fix possible hang-up of regression test 054.postgres_fdw (Yugo Nagata)
- test: Add option to regress.sh and pgpool_setup for unix domain socket
directory (Yugo Nagata)
- doc: Add missing descriptions about default values to documents
(Yugo Nagata)
- test: Fix regression test 055 for rhel7 rpm (Yugo Nagata)
- Fix reset query stuck problem (Muhammad Usama)
The issue is already fixed in older branches and this fix adopts the
same solution used by 3.3 series, i.e. closing the backend connection
when client idle limit is reached.
- Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii)
Pgpool-II remembers that non read only queries (including SET) were
executed in an explicit transaction and adds a "writing transaction"
mark to the transaction. The mark affects the query routing behavior
of pgpool-II while running in streaming replication mode. Pgpool-II
starts sending queries to the primary after the mark is set. Because
the effect of writing queries may appear on standbys after some delay
in streaming replication mode, it is safer to route read queries to
the primary after the mark is set.
However there's oversight here. "SET TRANSACTION READ ONLY" does no
data modification and should be treated as an exception.
Per bug #157.
- test: Fix to use timeout command to handle time out of regress test 062
(Yugo Nagata)
- Fix to show wrong error (Tatsuo Ishii)
connect_with_timeout() does not show proper error info when
getsockopt(SO_ERROR) reports an error. Pointed out in bug #159.
- test: Add regress.sh missing \n in help messages (Yugo Nagata)
- Fix the logic issue in get_backends_status() function (Muhammad Usama)
get_backends_status () function counts the number of current valid and down
backend nodes. The function assumed that the node was also invalid when its
connection status was down. However, that is not always right.
- Fix white/black_memqcache_table_list not to require quotation (Yugo Nagata)
The tables and schemas name specified in *_memqcache_table_list
were needed to be quoted by double quotation.
Patch contributed by Dang Minh Huong.
Per [pgpool-hackers: 1323]
- Fix FATAL error with reloading (Tatsuo Ishii)
While reloading pgpool.conf, the number of DB nodes is tentatively set
to 0, then counted up until reaching to the actual number of backends
by the pgpool main process. Unfortunately the variable was on the
shared memory and it confused pgpool child process when they were using
the variable and this caused FATAL error.
Per bug #156 report by harukat.
- test: Add some tests for white/black_memqcache_table_list to regression
test 006.memqcache (Yugo Nagata)
- Fix reset query stuck problem (Muhammad Usama, Tatsuo Ishii)
When pool_read fails to read from frontend or pool_flush fails to
write to the frontend, report FRONTEND_ERROR, rather than ERROR to
disconnect and terminate pgpool child process, to prevent the query
stuck problem.
- test: Fix some regression tests that failed in debug mode (Yugo Nagata)
- Fix performance degradation while using IPv6 (Muhammad Usama)
Per bug #165.
===============================================================================
3.4 Series (2014/11/07 - )
===============================================================================
3.4.8 (tataraboshi) 2016/08/31
* Version 3.4.8
This is a bugfix release against pgpool-II 3.4.7.
__________________________________________________________________
* Bug fixes
- Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii)
While processing "show pool_nodes", the buffer for hostname was too
short. It should be same size as the buffer used for pgpool.conf.
Problem reported by a twitter user who is using pgpool on AWS (which
could have very long hostname).
- Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii)
The usage of wait(2) in pgpool main could cause infinite wait in the
system call. Solution is, to use waitpid(2) instead of wait(2).
- Save and restore errno in each signal handler. (Tatsuo Ishii)
- Fix handling of pcp_listen_addresses config parameter. (Muhammad Usama)
- Fix "kind mismatch" error message in pgpool. (Muhammad Usama)
Many of "kind mismatch..." errors are caused by notice/warning
messages produced by one or more of the DB nodes. In this case now
Pgpool-II forwards the messages to frontend, rather than throwing the
"kind mismatch..." error. This would reduce the chance of "kind
mismatch..." errors.
See [pgpool-hackers: 1501] for more details.
- Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii)
The macro calls pool_virtual_master_db_node_id() and then access
backend->slots[id]->con using the node id returned. In rare cases, it
could point to 0 (in case when the DB node is not connected), which
gives access to con->major, then it causes a segfault.
See bug 225 for related info.
- doc : Fixing a typo in english doc (Muhammad Usama)
- doc : fix Japanese document typo. (Bo Peng)
- Fixing a typo in the log message. (Muhammad Usama)
- Tighten up health check timer expired condition in pool_check_fd(). (Muhammad Usama)
- doc : Add comment to the document about connection_cache. (Tatsuo Ishii)
- Fix for 237 that Pgpool-II fails to start if listen_addresses is empty string.
(Muhammad Usama)
The socket descriptor array (fds[]) was not getting the array end marker
when TCP listen addresses are not used.
See bug 237 for related info.
===============================================================================
3.4.7 (tataraboshi) 2016/06/17
* Version 3.4.7
This is a bugfix release against pgpool-II 3.4.6.
__________________________________________________________________
* New features
- Allow to access to pgpool while doing health checking (Tatsuo Ishii)
Currently any attempt to connect to pgpool fails if pgpool is doing
health check against failed node even if fail_over_on_backend_error is
off because pgpool child first tries to connect to all backend
including the failed one and exits if it fails to connect to a backend
(of course it fails). This is a temporary situation and will be
resolved before pgpool executes failover. However if the health check
is retrying, the temporary situation keeps longer depending on the
setting of health_check_max_retries and health_check_retry_delay. This
is not good. Attached patch tries to mitigate the problem:
- When an attempt to connect to backend fails, give up connecting to
the failed node and skip to other node, rather than exiting the
process if operating in streaming replication mode and the node is
not primary node.
- Mark the local status of the failed node to "down".
- This will let the primary node be selected as a load balance node
and every queries will be sent to the primary node. If there's other
healthy standby nodes, one of them will be chosen as the load
balance node.
- After the session is over, the child process will suicide to not
retain the local status.
Per [pgpool-hackers: 1531].
* Bug fixes
- Fix is_set_transaction_serializable() when
SET default_transaction_isolation TO 'serializable'. (Bo Peng)
SET default_transaction_isolation TO 'serializable' is sent to
not only primary but also to standby server in streaming replication mode,
and this causes an error. Fix is, in streaming replication mode,
SET default_transaction_isolation TO 'serializable' is sent only to the
primary server.
See bug 191 for related info.
- Fix Chinese documentation bug about raw mode (Yugo Nagata, Bo Peng)
Connection pool is available in raw mode.
- Fix confusing comments in pgpool.conf (Tatsuo Ishii)
- Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama)
Currently TLSv1_method() is used to initialize the SSL context, that puts an
unnecessary limitation to allow only TLSv1 protocol for SSL communication.
While postgreSQL supports other ciphers protocols as well. The commit changes
the above and initializes the SSLSession using the SSLv23_method()
(same is also used by PostgreSQL). Because it can negotiate the use of the
highest mutually supported protocol version and remove the limitation of one
specific protocol version.
- If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii)
query to primary node, and all of following user queries are sent to
standby, it is possible that the next command, for example END, could
cause a statement timeout error on the primary, and a kind mismatch
error on pgpool-II is raised.
This fix tries to mitigate the problem by sending sync message instead
of flush message in do_query(), expecting that the sync message reset
the statement timeout timer if we are in an explicit transaction. We
cannot use this technique for implicit transaction case, because the
sync message removes the unnamed portal if there's any.
Plus, pg_stat_statement will no longer show the query issued by
do_query() as "running".
See bug 194 for related info.
- Fix a possible hang during health checking (Yugo Nagata)
Health checking was hang when any data wasn't sent
from backend after connect(2) succeeded. To fix this,
pool_check_fd() returns 1 when select(2) exits with
EINTR due to SIGALRM while health checking is performed.
Reported and patch provided by harukat and some modification
by Yugo.
See bug 204 for related info.
- change the Makefile under this directory src/sql/,that is proposed by (Bo Peng)
[pgpool-hackers: 1611]
- Fix bug with load balance node id info on shmem (Tatsuo Ishii)
There are few places where the load balance node was mistakenly put on
wrong place. It should be placed on:
ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node].
In fact it was placed on:
*con_info[child id, connection pool_id, 0].load_balancing_node].
As long as the backend id in question is 0, it is ok. However while
testing pgpool-II 3.6's enhancement regarding failover, if primary
node is 1 (which is the load balance node) and standby is 0, a client
connecting to node 1 is disconnected when failover happens on node
0. This is unexpected and the bug was revealed.
It seems the bug was there since long time ago but it had not found
until today by the reason above.
- Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if
primary is not node 0, then statement timeout could occur even after
bug194-3.3.diff was applied. After some investigation, it appeared
that MASTER macro could return other than primary or load balance
node, which was not supposed to happen, thus do_query() sends queries
to wrong node (this is not clear from the report but I confirmed it in
my investigation).
pool_virtual_master_db_node_id(), which is called in MASTER macro
returns query_context->virtual_master_node_id if query context
exists. This could return wrong node if the variable has not been set
yet. To fix this, the function is modified: if the variable is not
either load balance node or primary node, the primary node id is
returned.
===============================================================================
3.4.6 (tataraboshi) 2016/04/26
* Version 3.4.6
This is a bugfix release against pgpool-II 3.4.5.
__________________________________________________________________
* Bug fixes
- Fix for segfault during trusted_servers check (Muhammad Usama)
PostgreSQL's memory and exception manager APIs adopted by the
pgpool 3.4 are not thread safe and are causing the segmentation fault
in the watchdog lifecheck process, as it uses the threads to ping
configured trusted hosts for checking the upstream connections.
Fix is to remove threads and use the child process approach instead.
See [pgpool-general: 4569] for more details.
- Removing the limit on the maximum number of items in the
black_function_list and white_function_list lists. (Muhammad Usama)
extract_string_tokens in pool_config uses the fixed size malloc on
the array to hold the black_function_list/white_function_list items.
This imposes a limit of maximum items in these lists.
The fix is to use realloc to increase the array size when it gets full.
- Redirect all user queries to primary server (Tatsuo Ishii)
Up to now some user queries are sent to other than the primary server
even if load_balance_mode = off. This commit changes the behavior: if
load_balance_mode = off in streaming replication mode, now all the
user queries are sent to the primary server only.
Per bug #189.
- Change the PID length of pcp_proc_count command result to 6 characters
long (Bo Peng)
If the pgpool process ID are over 5 characters, the 6th character of each
process ID will be removed. This commit changes the process ID length of
pcp_proc_count command result to 6 characters long.
Per bug #188.
===============================================================================
3.4.5 (tataraboshi) 2016/04/04
* Version 3.4.5
This is a bugfix release against pgpool-II 3.4.4.
__________________________________________________________________
* Bug fixes
- test: Fix test/regression/clean.sh to remove binary files of
010.rewrite_timestamp test (Yugo Nagata)
- Fix memory leak reported by Coverity (CID 1350095) (Yugo Nagata)
- Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6
(Muhammad Usama)
Incorporating the change of function signature for GetConfigOption..()
functions in PostgreSQL 9.6.
- Fix a reset query stuck problem (Muhammad Usama)
The solution is to report FRONTEND_ERROR instead of simple ERROR when
pool_flush on front-end socket fails.
The original report is
[pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL
The patch was generated by Usama and Pawel Ufnalewski<archon@foap.com>,
and Gerhard Wiesinger <lists@wiesinger.com> helped to verify and test
the fix.
- Fix typo in configure (Tatsuo Ishii)
Patch provided by Thomas Munro.
- doc: Change description of backend_flag (Tatsuo Ishii)
It is pointed out that restarting pgpool-II is not necessary.
Per [pgpool-general-jp: 1394].
- doc: Fix installation procedure. (Tatsuo Ishii)
With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed.
- test: Fix pgpool_setup to not confuse log output (Tatsuo Ishii)
Before it simply redirects stdout and stderr of pgpool processes to
a log file. This could cause the log contents being garbled or even
missed because of race condition caused by multiple process being
writing concurrently.
To fix this, pgpool_setup now generates startall script in which pgpool
sends stdout/stderr to cat command by pipe, and cat writes to the log
file.
- Fix to validate the PCP packet length (Muhammad Usama)
Without the validation check, a malformed PCP packet can crash the
PCP child and/or can run the server out of memory by sending the packet
with a very large data size.
===============================================================================
3.4.4 (tataraboshi) 2016/02/05
* Version 3.4.4
This is a bugfix release against pgpool-II 3.4.3.
__________________________________________________________________
* Bug fixes
- doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii)
In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent
to primary node only. Pointed out in [pgpool-general-jp: 1378].
- Issue fsync() when writing pgpool_status (Tatsuo Ishii)
This ensures that pgpool_status is saved to permanent storage and
allow to survive after system crash.
- Fix reset query stuck problem (Muhammad Usama)
It is reported that reset query (DISCARD ALL etc.) occasionally does
not finish and pgpool child remain waiting for reply from the backend
thus client cannot connect to pgpool (for example bug report #107).
The cause of problem is not identified yet but if client suddenly
closes connection to pgpool in the middle of query processing, backend
may not accept the reset queries because they are not ready for query.
The fix is to keep track of the status of frontend socket state and not
caching the PostgreSQL connection if the connection to frontend was not
properly terminated.
- test: Fix false alarm of regression tset 062 (Yugo Nagata)
- test: Fix broken regression test for native replication (Yugo Nagata)
Test for insert lock didn't work.
- test: Fix regress test to sleep after pgpool_reload (Yugo Nagata)
Some regression tests modify configuration file and reloads. However,
sometimes these were not applied to pgpool just after reloading.
- Fix inconsistency of sequence values in replication mode (Yugo Nagata)
When a schema name was provided, the table name was quoted wrongly as
like "public.mytbl" instead of "public"."mytbl". So, pool_regclass
and to_regclass couldn't find right table oid and insert lock was
never executed. This caused inconsistency between DB nodes.
- test: Fix complication error and segfault of timestamp rewrite test
(Yugo Nagata)
- test: Add timestamp-rewrite unit test to regression test suite (Yugo Nagata)
- doc: Fix untranslated sentence in Japanese document (Yugo Nagata)
- Fix ancient bug of pool_push() and friends (Tatsuo Ishii)
It allocates buffer using realloc and uses the pointer
returned. However it does the pointer calculation *before* realloc
gets called. So the calculation uses the old pointer value, which
causes various problems including segfault later.
Also there were other problems with it. The buffer pointer and buffer
size variable is not initialized. The buffer is not freed by
pool_close. Typo in debugging message (3.4 or later only). They are
fixed as well.
- doc: Fix wrong description about log_standby_delay in the document
(Yugo Nagata)
- doc: Add caution about JDBC driver version regarding
app_name_redirect_preference_list (Tatsuo Ishii)
- Fix hang problem reported in bug#145 (Tatsuo Ishii)
The problem occurs when all the condition below are met:
1) pgpool-II 3.4 or later
2) streaming replication mode
3) primary node is also load balance node
4) extended protocol is used
5) client_idle_limit reached
- test: Fix regression test 065 (Tatsuo Ishii)
The path to JDBC driver was explicitly defined. This is wrong. This
should be inherited from JDBC_DRIVER environment variable.
- test: Fix possible hang-up of regression test 054.postgres_fdw (Yugo Nagata)
- test: Add option to regress.sh and pgpool_setup for unix domain socket
directory (Yugo Nagata)
- doc: Add missing descriptions about default values to documents (Yugo Nagata)
- test: Fix a bug of regress.sh option handling (Yugo Nagata)
- test: Fix regression test 055.backend_all_down to use PGSOCKET_DIR for
PostgreSQL rhel7 rpm (Yugo Nagata)
- Fix reset query stuck problem (Muhammad Usama)
The issue is already fixed in older branches and this fix adopts the
same solution used by 3.3 series, i.e. closing the backend connection
when client idle limit is reached.
- Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii)
Pgpool-II remembers that non read only queries (including SET) were
executed in an explicit transaction and adds a "writing transaction"
mark to the transaction. The mark affects the query routing behavior
of pgpool-II while running in streaming replication mode. Pgpool-II
starts sending queries to the primary after the mark is set. Because
the effect of writing queries may appear on standbys after some delay
in streaming replication mode, it is safer to route read queries to
the primary after the mark is set.
However there's oversight here. "SET TRANSACTION READ ONLY" does no
data modification and should be treated as an exception.
Per bug #157.
- test: Fix to use timeout command to handle time out of regress test 062
(Yugo Nagata)
- Fix to show wrong error (Tatsuo Ishii)
connect_with_timeout() does not show proper error info when
getsockopt(SO_ERROR) reports an error. Pointed out in bug #159.
- test: Add missing \n in help messages (Yugo Nagata)
- Fixing the logic issue in get_backends_status() function (Muhammad Usama)
get_backends_status () function counts the number of current valid and down
backend nodes. The function assumed that the node was also invalid when its
connection status was down. However, that is not always right.
- test: Fix regression test 003.failover for rhel7 postgresql rpm (Yugo Nagata)
The expected result of 'show pool_nodes' is fixed to use
PGSOCKET_DIR in hostname column.
- Fix white/black_memqcache_table_list not require quotation (Yugo Nagata)
The tables and schemas name specified in *_memqcache_table_list
were needed to be quoted by double quotation.
Patch contributed by Dang Minh Huong.
Per [pgpool-hackers: 1323]
- Fix FATAL error with reloading (Tatsuo Ishii)
While reloading pgpool.conf, the number of DB nodes is tentatively set
to 0, then counted up until reaching to the actual number of backends
by the pgpool main process. Unfortunately the variable was on the
shared memory and it confused pgpool child process when they were using
the variable and this caused FATAL error.
Per bug #156 report by harukat.
- test: Add some tests for white/black_memqcache_table_list to regression
test 006.memqcache (Yugo Nagata)
- Fix reset query stuck problem (Muhammad Usama, Tatsuo Ishii)
When pool_read fails to read from frontend or pool_flush fails to
write to the frontend, report FRONTEND_ERROR, rather than ERROR to
disconnect and terminate pgpool child process, to prevent the query
stuck problem.
- test: Fix regression test 008 & 009 failure in debug mode (Yugo Nagata)
- Fix performance degradation while using IPv6 (Muhammad Usama)
Per bug #165.
- Add some warning messages for wd_authkey hash calculation failure
(Yugo Nagata)
Sometimes wd_authkey calculation fails for some reason other than
authkey mismatch. The additional messages make these distinguishable
for each other.
- test: Fix regression test to check timeout of each test (Yugo Nagata)
- test: Allow timeout value to be specified by the command option (Yugo Nagata)
- Fix bugs with data modifying WITH clause. (Tatsuo Ishii)
pgpool-II did not recognize the data modifying WITH clause despite
pgpool-II 3.3 or after has SQL parser which recognizes it. The bug has
been fixed in pgpool-II 3.5 (having PostgreSQL 9.5 parser), and the fix
is back ported to pgpool-II 3.3 and 3.4.
Per bug #153.
- Fix segfault that occurs when function is used in FROM clause (Yugo Nagata)
PREPARE statements in streaming-reapplication mode and INSERT/UPDATE
with SELECT in native-replication mode were affected. For example:
- prepare p as select * from generate_series(1,1);
- insert into tbl select now(), * from generate_series(1,1);
- Fix broken arping_cmd configuration check(Muhammad Usama)
wd_chk_setuid() function was bailing out with the NOTICE message as soon
as it finds the setuid bit is not set on any configured network command
and was ignoring the rest of configurations.
Per bug #139.
- doc: Add restriction about starting multiple pgpool simultaneously
(Yugo Nagata)
- Fix to use saved errno for erreport instead of the direct value
(Yugo Nagata)
Some system calls are called in errmsg() and errhint(), and
it isn't safe to pass errno directly as an argument. This caused
the confusable log message as below.
DETAIL: connect() reports failure "Success"
- Fix a in-memory query cache bug (Tatsuo Ishii)
If extended query protocol is used and a bind/execute message arrives
which uses a statement created by prior parse message, the temp_cache
is not initialized by a parse messages. Thus messages are added to pre
existing temp cache buffer which causes the trouble, that is, when the
cached result returns, Data Row message and Command Complete message
appeared twice.
Per by bug #152.
- Fix a compile issue on freebsd, added missing include files (Muhammad Usama)
===============================================================================
3.4.3 (tataraboshi) 2015/07/24
* Version 3.4.3
This is a bugfix release against pgpool-II 3.4.2.
__________________________________________________________________
* Bug fixes
- Fix "cannot find xlog functions" error in pgpool-recovery
(Muhammad Usama)
The argument data type of PostgreSQL's pg_xlogfile_name() function
has been changed from text to pg_lsn since PostgreSQL 9.4. And
pgpool-recovery was still trying to locate the function by old
signature.
- Fix problem with memory cache invalidation (Muhammad Usama)
The internal buffer for storing the table oids needs to be homed in
long living memory context as it has to survive throughout the child
life.
See [pgpool-general: 3643] for details.
- Pass empty string parameters in failover command when pgpool-II
does not have a value for any particular parameter (Muhammad Usama)
Instead of omitting the values for the parameters when pgpool-II does
not have any value for a particular parameter, it now passes an empty
string to the failover command. This makes sure that failover script
will always receive the exact number of expected parameters.
- pgpool-II should use the local definition of snprintf functions only
if they are not provided by OS (Muhammad Usama)
- Add debug info to show how much shared memory is allocated
(Tatsuo Ishii)
- Downgrading the error level for EOF on backend connection for main
process (Muhammad Usama)
Throwing the FATAL error when EOF is encountered with backend is very
harsh in pgpool main process and can cause undesirable behavior.
Downgrading it to simple ERROR.
- doc: Clarify load balancing condition (Tatsuo Ishii)
- doc: Clarify description of pcp_promote_node (Tatsuo Ishii)
It does not actually promote PostgreSQL standby.
- doc: Fix outdated limitation description about load balancing using
JDBC driver (Tatsuo Ishii)
Even if autocommit is false, load balancing is possible in certain
conditions.
- Fix a misplaced code which makes a log code unreachable and rephrase
the log message (Muhammad Usama)
- Fix a problem in elog.c when forwarding a message to frontend clients
(Muhammad Usama)
Error while forwarding the message to the frontend client can
potentially cause the infinite recursion and terminate the child with
ERRORDATA_STACK_SIZE exceeded error.
Fix is to check the recursion depth of send_message_to_frontend()
function and pulling the plug if it is more than two levels deep.
- Fix "select() system call interrupted" error (Tatsuo Ishii)
The health check process complains above and then:
ERROR: failed to make persistent db connection
DETAIL: connection to host:"x.x.x.x:5432 failed
However, the healthcheck triggers neither fail over nor retrying. So,
except the annoying messages above, everything goes well. This could
occur more easily if 1) num_init_children is big and 2) pgpool
children go into idle state (no query arrived from client for
child_life_time seconds).
Original bug report is [pgpool-general: 3756] Connection Interrupted.
Patch created by Tatsuo Ishii. Enhancement from Usama.
- Fix the case when user table includes spaces (Tatsuo Ishii)
For example if table names including spaces are used, pgpool-II cannot
be handled correctly by the internal functions which access system
catalogs and it results in SQL errors. Solution is, to always use
delimited identifier.
Per bug #136.
http://www.pgpool.net/mantisbt/view.php?id=136
Also see [pgpool-general: 3818].
- Allow to use in-memory query cache size more than 4GB (Tatsuo Ishii)
This should have been allowed since in memory query cache was born.
- Do not send a query for checking insert lock in non replication mode
with extended query (Tatsuo Ishii)
- Save pgpool_status to disk each time when it is changed
(Tatsuo Ishii)
Previously, pgpool-II saves pgpool_status file when pgpool-II
explicitly is going shutdown. This is fine in most cases and it saves
slight CPU cycles. But if pgpool-II killed abnormally or the system
forces pgpool-II to go down by OOM killer, next pgpool-II restarting
could load obsolete status file.
===============================================================================
3.4.3 (tataraboshi) 2015/07/24
* Version 3.4.3
This is a bugfix release against pgpool-II 3.4.2.
__________________________________________________________________
* Bug fixes
- Fix "cannot find xlog functions" error in pgpool-recovery
(Muhammad Usama)
The argument data type of PostgreSQL's pg_xlogfile_name() function
has been changed from text to pg_lsn since PostgreSQL 9.4. And
pgpool-recovery was still trying to locate the function by old
signature.
- Fix problem with memory cache invalidation (Muhammad Usama)
The internal buffer for storing the table oids needs to be homed in
long living memory context as it has to survive throughout the child
life.
See [pgpool-general: 3643] for details.
- Pass empty string parameters in failover command when pgpool-II
does not have a value for any particular parameter (Muhammad Usama)
Instead of omitting the values for the parameters when pgpool-II does
not have any value for a particular parameter, it now passes an empty
string to the failover command. This makes sure that failover script
will always receive the exact number of expected parameters.
- pgpool-II should use the local definition of snprintf functions only
if they are not provided by OS (Muhammad Usama)
- Add debug info to show how much shared memory is allocated
(Tatsuo Ishii)
- Downgrading the error level for EOF on backend connection for main
process (Muhammad Usama)
Throwing the FATAL error when EOF is encountered with backend is very
harsh in pgpool main process and can cause undesirable behavior.
Downgrading it to simple ERROR.
- doc: Clarify load balancing condition (Tatsuo Ishii)
- doc: Clarify description of pcp_promote_node (Tatsuo Ishii)
It does not actually promote PostgreSQL standby.
- doc: Fix outdated limitation description about load balancing using
JDBC driver (Tatsuo Ishii)
Even if autocommit is false, load balancing is possible in certain
conditions.
- Fix a misplaced code which makes a log code unreachable and rephrase
the log message (Muhammad Usama)
- Fix a problem in elog.c when forwarding a message to frontend clients
(Muhammad Usama)
Error while forwarding the message to the frontend client can
potentially cause the infinite recursion and terminate the child with
ERRORDATA_STACK_SIZE exceeded error.
Fix is to check the recursion depth of send_message_to_frontend()
function and pulling the plug if it is more than two levels deep.
- Fix "select() system call interrupted" error (Tatsuo Ishii)
The health check process complains above and then:
ERROR: failed to make persistent db connection
DETAIL: connection to host:"x.x.x.x:5432 failed
However, the healthcheck triggers neither fail over nor retrying. So,
except the annoying messages above, everything goes well. This could
occur more easily if 1) num_init_children is big and 2) pgpool
children go into idle state (no query arrived from client for
child_life_time seconds).
Original bug report is [pgpool-general: 3756] Connection Interrupted.
Patch created by Tatsuo Ishii. Enhancement from Usama.
- Fix the case when user table includes spaces (Tatsuo Ishii)
For example if table names including spaces are used, pgpool-II cannot
be handled correctly by the internal functions which access system
catalogs and it results in SQL errors. Solution is, to always use
delimited identifier.
Per bug #136.
http://www.pgpool.net/mantisbt/view.php?id=136
Also see [pgpool-general: 3818].
- Allow to use in-memory query cache size more than 4GB (Tatsuo Ishii)
This should have been allowed since in memory query cache was born.
- Do not send a query for checking insert lock in non replication mode
with extended query (Tatsuo Ishii)
- Save pgpool_status to disk each time when it is changed
(Tatsuo Ishii)
Previously, pgpool-II saves pgpool_status file when pgpool-II
explicitly is going shutdown. This is fine in most cases and it saves
slight CPU cycles. But if pgpool-II killed abnormally or the system
forces pgpool-II to go down by OOM killer, next pgpool-II restarting
could load obsolete status file.
===============================================================================
3.4.2 (tataraboshi) 2015/04/08
* Version 3.4.2
This is a bugfix release against pgpool-II 3.4.1.
__________________________________________________________________
* Bug fixes
- rpm: Fix %tmpfiles_create to not be executed in RHEL/CentOS 6
(Nozomi Anzai)
- Fix to reset on_exit call back functions in exec_if_cmd and exec_ping
worker processes (Muhammad Usama)
exec_if and exec_ping child processes were inheriting the parent exit
callback functions which could result in undesired behavior if one of
these commands fails. Fixed by adding on_exit_reset() at child start-up
in both processes.
- Fix to use void * type for receiving return value of thread function
(Yugo Nagata)
Previously int type was used and this could occur stack buffer
overflow. This caused an infinity loop of ping error at bringing
up or down VIP.
- Fix to set SIGCHLD to SIG_DFL instead of SIG_IGN in watchdog processes
(Yugo Nagata)
When using waitpid, it isn't necessary to set SIGCHLD to SIG_IGN.
Rather, it is harmful, and due to this it was regarded that ping
command exited abnormally in error even when this succeeded.
- Fix to use waitpid instead of wait in exec_ifconfig (Yugo Nagata)
- Remove an unnecessary include directive (Yugo Nagata)
- Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii)
This is used in show pool_status command and limits the length of
parameter description. Unfortunately recovery_timeout description is
64 chars, which is 1 byte longer than former definition of the macro.
- doc: Update document of condition for load balancing (Yugo Nagata)
Load balancing is possible in an explicit transaction block
even in replication mode since 3.3.0.
- Support SSL certificate chains in the certificate file for incoming
frontend connections (Muhammad Usama)
- Use to_regclass if available in time stamp rewriting in replication
mode (Tatsuo Ishii)
- Fix to not emits a fatal error message when clear text password auth
is used (Muhammad Usama)
The problem was introduced in pgpool-II after inclusion of exception
manager. EOF on the frontend connection during client authentication
should not be treated as an error when the password authentication
method is used. psql disconnects from the server in such case to get
the password from the terminal, reconnects and sends the read password
to server.
- previous session for the same child had exited because of some ERROR.
(Muhammad Usama)
- Fix a hang when an error occurs in a transaction block with
replication mode (Yugo Nagata)
When an error occurs at a backend node in a transaction block with
replication mode, pgpool-II sends an invalid query to other
backends to sync transaction states. However, previously, this was
not sent to master node, and pgpool-II was waiting for master's
response forever.
- Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama)
When graceful node detach is requested gracefully, pcp_detach_node should
check if it is allowed to process detach_node command on the particular
node before blocking the incoming connections and closing the existing
connections.
- doc: Update table and flowchart of where a query should be sent to
(Yugo Nagata)
- rpm: pgpool.spec is required only in RHEL/CentOS 7 (Nozomi Anzai)
- Fix a compilation issue about sighandler_t type on BSD variants
(Muhammad Usama)
===============================================================================
3.4.1 (tataraboshi) 2015/02/05
* Version 3.4.1
This is a bugfix release against pgpool-II 3.4.0.
__________________________________________________________________
* Bug fixes
- RPM: Add to support for memcached. (Tatsuo Ishii)
- Fix number of parameters of pgpool_recovery from 3 to 4. (Tatsuo Ishii)
This really should be done before releasing 3.4.0.
- test: Allow pgpool_setup to set configuration file directory by setting
environment variable PGPOOLDIR (Tatsuo Ishii)
- RPM: Rename RPM file (Yugo Nagata)
Rename filename to include the RHEL version number like PostgreSQL's
official RPM file. (e.g. pgpool-II-pg93-3.4.0-2pgdg.rhel6.x86_64.rpm)
- Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii)
The node id should be lower than NUM_BACKENDS. Probably harmless since
callers never pass node ids greater or equal to NUM_BACKENDS.
- Fix occasional stuck that occurs when a NOTIFY message is sent from
a backend. (Muhammad Usama)
The issue happens in master slave mode with load balancing when the
client is doing extended query messaging.
per bug #116
http://www.pgpool.net/mantisbt/view.php?id=116
- test: Fix failover script of pgpool_setup to use absolute path to the
database cluster (Tatsuo Ishii)
- test: Reorganize port numbers assigned in pgpool_setup (Tatsuo Ishii)
Assign base port (11000 by default) to pgpool, base port + 1 to pcp,
port + 2 to PostgreSQL node0, port + 3 to PostgreSQL node1 and so on.
- Fix a bug that pgpool-II 3.4 can't cancel query (Muhammad Usama)
- test: Add regression test for cancelling query (Muhammad Usama)
- Fix to not use non-thread-safe APIs in thread functions
(Muhammad Usama)
pgpool-II has borrowed the Memory and Exception managers from PostgreSQL
which never utilizes the threads so its APIs are not thread safe.
Previously, those API functions which manipulate the global variables
in thread functions, and it caused to undefined behavior or a
segmentation fault. Especially, the main process could die silently.
- test: Add memory leak regression test (Tatsuo Ishii)
- Fix a memory leak with long-lived connections (Muhammad Usama)
Problem reported in [pgpool-general: 3325].
- Change the log level of "Frontend Terminated" message to DEBUG1 from LOG
(Muhammad Usama)
- Fix ill signal behavior of SIGCHLD in exec_ifconfig() (Tatsuo Ishii)
For some reason SIGCHLD was set to SIG_IGN *and* tries to wait
child process which always fails because SIGCHLD is never delivered.
Due to this "ifconfig up" fails when switching to watchdog master.
See "[pgpool-general: 3310] for more details.
- Allow $_IP_$ having address prefix in if_up_cmd and if_down_cmd
(Muhammad Usama)
Previously, it is assumed that "$_IP_$" keyword will always have a
white space at the end, and when "$_IP_$" has address prefix (e.g.
$_IP_$/24), this prefix was ignored.
Per bug #122.
http://www.pgpool.net/mantisbt/view.php?id=122
- Fix to not send signal to init process (Muhammad Usama)
This is more of a guard against a situation where a crash of the
pgpool main process can make the child processes to send the signal
to system's init process.
Per bug #119.
http://www.pgpool.net/mantisbt/view.php?id=119
- RPM: Fix "error: Installed (but unpackaged) file(s) found" while
creating RPMs for PostgreSQL 9.4 (Tatsuo Ishii)
- Allow "show pool_nodes" to print node ids having more than one digits
(Muhammad Usama)
Problem reported in [pgpool-general: 3374].
- Prevent "WARNING: failed to execute regex matching, pattern is NULL"
message that could happen when application name is not set in the old
clients (Tatsuo Ishii)
- Fix pgpool main process to shutdown in case of child process start-up
failures (Muhammad Usama)
Problem reported in [pgpool-general: 3358].
- Fix a segmentation fault that could happen in child process error
(Muhammad Usama)
Problem reported in [pgpool-general: 3377].
- Fix occasional failure in regression test '004.watchdog' (Yugo Nagata)
The patch provided by uehara in bug #127.
http://www.pgpool.net/mantisbt/view.php?id=127
- Fix client connection leak (Tatsuo Ishii)
Since 3.4.0 pgpool-II child does not close the connection to client
when it ends the session. This leads to serious "CLOSE_WAIT" flood,
which makes pgpool-II unusable since no new connection from clients
accepted.
Problem reported by Pablo Sanchez in [pgpool-general: 3394].
- Restore SIGCHLD handler to its original after executing if_up/down_cmd
(Yugo Nagata)
Previously SIGCHLD was set to SIGIGN always after if_up/down_cmd.
This led to a incorrect error handling of ping or other commands
execution, and warning messages were output to log even when the
command exited successfully.
- RPM: Add pgpool.service for systemd in RHEL/CentOS 7 (Nozomi Anzai)
- Fix process termination after several reload with enabled_pool_hba
(Muhammad Usama)
- Tighten up checking for app_name_redirect_preference_list and
database_redirect_preference_list (Tatsuo Ishii)
Before empty application name or database name or invalid DB node
number were silently accepted. Now they are strictly checked and
let raise fatal error when starting up.
Problem reported in [pgpool-general-jp: 1337].
- RPM: Change to use systemd if it is available (Nozomi Anzai)
- Fix the behavior of "client_min_messages" configuration parameter
(Muhammad Usama)
This parameter controls the minimum message levels to be sent to the
frontend. Previously, regardless of the value of the parameter all
the messages with severity less than NOTICE level were not being
forwarded to the client.
===============================================================================
3.4.0 (tataraboshi) 2014/11/07
* Version 3.4.0
This is the first version of pgpool-II 3.4 series.
That is, a "major version up" from 3.3 series.
__________________________________________________________________
* Incompatible changes
- Parallel query mode is obsoleted and is removed from
pgpool.conf. This is due to the very few users using the mode
(and the relatively high cost to maintain it). Actual codes for
the mode are still there and users can use the mode if they
specify necessary parameters in pgpool.conf. Note, however, the
next version of pgpool-II (will be 3.5.0) will actually remove
the code.
- "print_timestamp" parameter is removed. Instead new
"log_line_prefix" should be used.
- Recovery script now accepts 4 parameters, rather than 3 (the 4th
parameter is the port number of master PostgreSQL). Existing
3-parameter-style recovery scripts can be used if you don't care
about information provided by the 4th parameter.
__________________________________________________________________
* New features
- Allow fine control of load balancing by using application name
or database name. For example, if a client has particular
application name, read queries can be redirect to master node,
rather than to one of slave nodes (Tatsuo Ishii)
- Allow to print pgpool-II process names in the log output. New
parameter "log_line_prefix", which is the printf-style string
that is output at the beginning of each log line (Muhammad Usama)
- Allow to control log verbosity like PostgreSQL. For this purpose
new parameters "log_error_verbosity", "client_min_messages",
"log_min_messages" are added (Muhammad Usama)
- Allow to use SQL comments without disturbing load balancing if
new parameter "allow_sql_comments" is on. If it's off, previous
behavior is kept (Tatsuo Ishii)
- Allow to skip unlogged tables checking by using new parameter
"check_unlogged_table". This reduces the number of pgpool-II's
internal catalog look up queries and enhances performance
(Tatsuo Ishii)
- Prevent listen backlog overflow by using new parameter
"listen_backlog_multiplier" for very busy systems (Tatsuo Ishii)
- Prevent connection timeout to backend by using new parameter
"connect_timeout". This is useful in unstable networks
(Tatsuo Ishii)
__________________________________________________________________
* Enhancements
- Builtin SQL parser is now compatible with PostgreSQL 9.4 (Muhammad Usama)
- Import PostgreSQL's memory manager and exception manager (Muhammad Usama)
- Reorganize source code tree (Muhammad Usama)
- The status file "pgpool_status" is now a plain ASCII file. This
allows to register down PostgreSQL nodes before pgpool-II
starts for example (Tatsuo Ishii)
- Allow to use IPv6 address for PostgreSQ (Michael Stapelberg)
- Allow to use IPv6 bind address for pgpool-II (Michael Stapelberg)
- Rename all occurrence of "on memory query cache" to "in memory
query cache" because latter is more correct in English (Tatsuo Ishii)
- Add 4th parameter "master node port number" to recovery script
(Tatsuo Ishii)
- Allow to handle more than 3 database nodes in pgpool_setup
(Tatsuo Ishii)
__________________________________________________________________
* Bug fixes (since 3.3.4)
- Fix failover deadlock problem in watchdog (Muhammad Usama). See
bug #105 and [pgpool-committers: 2195] for more details.
- As per the PostgreSQL specification, calling close on non
existing portals is not an error. So on the same footings this
commit ignores all such packets and return the 'close complete'
message to client with out going to backend (Muhammad Usama)
- Fix many issues/bugs found by Coverity (Muhammad Usama, Tatsuo Ishii)
===============================================================================
3.3 Series (2013/07/30 - )
===============================================================================
3.3.12 (tokakiboshi) 2016/08/31
* Version 3.3.12
This is a bugfix release against pgpool-II 3.3.11.
__________________________________________________________________
* Bug fixes
- Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii)
While processing "show pool_nodes", the buffer for hostname was too
short. It should be same size as the buffer used for pgpool.conf.
Problem reported by a twitter user who is using pgpool on AWS (which
could have very long hostname).
- Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii)
The usage of wait(2) in pgpool main could cause infinite wait in the
system call. Solution is, to use waitpid(2) instead of wait(2).
- Fix "kind mismatch" error message in pgpool. (Muhammad Usama)
Many of "kind mismatch..." errors are caused by notice/warning
messages produced by one or more of the DB nodes. In this case now
Pgpool-II forwards the messages to frontend, rather than throwing the
"kind mismatch..." error. This would reduce the chance of "kind
mismatch..." errors.
See [pgpool-hackers: 1501] for more details.
- Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii)
The macro calls pool_virtual_master_db_node_id() and then access
backend->slots[id]->con using the node id returned. In rare cases, it
could point to 0 (in case when the DB node is not connected), which
gives access to con->major, then it causes a segfault.
See bug 225 for related info.
- doc : Fixing a typo in english doc (Muhammad Usama)
- doc : fix Japanese document typo. (Bo Peng)
- Fixing a typo in the log message. (Muhammad Usama)
- doc : Add comment to the document about connection_cache. (Tatsuo Ishii)
===============================================================================
3.3.11 (tokakiboshi) 2016/06/17
* Version 3.3.11
This is a bugfix release against pgpool-II 3.3.10.
__________________________________________________________________
* New features
- Allow to access to pgpool while doing health checking (Tatsuo Ishii)
Currently any attempt to connect to pgpool fails if pgpool is doing
health check against failed node even if fail_over_on_backend_error is
off because pgpool child first tries to connect to all backend
including the failed one and exits if it fails to connect to a backend
(of course it fails). This is a temporary situation and will be
resolved before pgpool executes failover. However if the health check
is retrying, the temporary situation keeps longer depending on the
setting of health_check_max_retries and health_check_retry_delay. This
is not good. Attached patch tries to mitigate the problem:
- When an attempt to connect to backend fails, give up connecting to
the failed node and skip to other node, rather than exiting the
process if operating in streaming replication mode and the node is
not primary node.
- Mark the local status of the failed node to "down".
- This will let the primary node be selected as a load balance node
and every queries will be sent to the primary node. If there's other
healthy standby nodes, one of them will be chosen as the load
balance node.
- After the session is over, the child process will suicide to not
retain the local status.
Per [pgpool-hackers: 1531].
* Bug fixes
- Fix is_set_transaction_serializable() when
SET default_transaction_isolation TO 'serializable'. (Bo Peng)
SET default_transaction_isolation TO 'serializable' is sent to
not only primary but also to standby server in streaming replication mode,
and this causes an error. Fix is, in streaming replication mode,
SET default_transaction_isolation TO 'serializable' is sent only to the
primary server.
See bug 191 for related info.
- Fix Chinese documentation bug about raw mode (Yugo Nagata, Bo Peng)
Connection pool is available in raw mode.
- Fix confusing comments in pgpool.conf (Tatsuo Ishii)
- Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama)
Currently TLSv1_method() is used to initialize the SSL context, that puts an
unnecessary limitation to allow only TLSv1 protocol for SSL communication.
While postgreSQL supports other ciphers protocols as well. The commit changes
the above and initializes the SSLSession using the SSLv23_method()
(same is also used by PostgreSQL). Because it can negotiate the use of the
highest mutually supported protocol version and remove the limitation of one
specific protocol version.
- If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii)
query to primary node, and all of following user queries are sent to
standby, it is possible that the next command, for example END, could
cause a statement timeout error on the primary, and a kind mismatch
error on pgpool-II is raised.
This fix tries to mitigate the problem by sending sync message instead
of flush message in do_query(), expecting that the sync message reset
the statement timeout timer if we are in an explicit transaction. We
cannot use this technique for implicit transaction case, because the
sync message removes the unnamed portal if there's any.
Plus, pg_stat_statement will no longer show the query issued by
do_query() as "running".
See bug 194 for related info.
- Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if
primary is not node 0, then statement timeout could occur even after
bug194-3.3.diff was applied. After some investigation, it appeared
that MASTER macro could return other than primary or load balance
node, which was not supposed to happen, thus do_query() sends queries
to wrong node (this is not clear from the report but I confirmed it in
my investigation).
pool_virtual_master_db_node_id(), which is called in MASTER macro
returns query_context->virtual_master_node_id if query context
exists. This could return wrong node if the variable has not been set
yet. To fix this, the function is modified: if the variable is not
either load balance node or primary node, the primary node id is
returned.
- change the Makefile under the directory src/sql/, that is proposed (Bo Peng)
by [pgpool-hackers: 1611]
- Fix a possible hang during health checking (Yugo Nagata)
Health checking was hang when any data wasn't sent
from backend after connect(2) succeeded. To fix this,
pool_check_fd() returns 1 when select(2) exits with
EINTR due to SIGALRM while health checking is performed.
Reported and patch provided by harukat and some modification
by Yugo. Per bug #204.
backported from 3.4 or later;
https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=ed9f2900f1b611f5cfd52e8f758c3616861e60c0
- Fix bug with load balance node id info on shmem (Tatsuo Ishii)
There are few places where the load balance node was mistakenly put on
wrong place. It should be placed on: ConnectionInfo *con_info[child
id, connection pool_id, backend id].load_balancing_node]. In fact it
was placed on: *con_info[child id, connection pool_id,
0].load_balancing_node].
As long as the backend id in question is 0, it is ok. However while
testing pgpool-II 3.6's enhancement regarding failover, if primary
node is 1 (which is the load balance node) and standby is 0, a client
connecting to node 1 is disconnected when failover happens on node
0. This is unexpected and the bug was revealed.
It seems the bug was there since long time ago but it had not found
until today by the reason above.
===============================================================================
3.3.10 (tokakiboshi) 2016/04/26
* Version 3.3.10
This is a bugfix release against pgpool-II 3.3.9.
__________________________________________________________________
* Bug fixes
- Removing the limit on the maximum number of items in the
black_function_list and white_function_list lists. (Muhammad Usama)
extract_string_tokens in pool_config uses the fixed size malloc on
the array to hold the black_function_list/white_function_list items.
This imposes a limit of maximum items in these lists.
The fix is to use realloc to increase the array size when it gets full.
- Redirect all user queries to primary server (Tatsuo Ishii)
Up to now some user queries are sent to other than the primary server
even if load_balance_mode = off. This commit changes the behavior: if
load_balance_mode = off in streaming replication mode, now all the
user queries are sent to the primary server only.
Per bug #189.
- Change the PID length of pcp_proc_count command result to 6 characters
long (Bo Peng)
If the pgpool process ID are over 5 characters, the 6th character of each
process ID will be removed. This commit changes the process ID length of
pcp_proc_count command result to 6 characters long.
Per bug #188.
===============================================================================
3.3.9 (tokakiboshi) 2016/04/04
* Version 3.3.9
This is a bugfix release against pgpool-II 3.3.8.
__________________________________________________________________
* Bug fixes
- test: Fix test/regression/clean.sh to remove binary files of
010.rewrite_timestamp test (Yugo Nagata)
- Fix memory leak reported by Coverity (CID 1350095) (Yugo Nagata)
- Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6
(Muhammad Usama)
Incorporating the change of function signature for GetConfigOption..()
functions in PostgreSQL 9.6.
- Fix typo in configure (Tatsuo Ishii)
Patch provided by Thomas Munro.
- doc: Change description of backend_flag (Tatsuo Ishii)
It is pointed out that restarting pgpool-II is not necessary.
Per [pgpool-general-jp: 1394].
- doc: Fix installation procedure. (Tatsuo Ishii)
With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed.
- test: Fix pgpool_setup to not confuse log output (Tatsuo Ishii)
Before it simply redirects stdout and stderr of pgpool processes to
a log file. This could cause the log contents being garbled or even
missed because of race condition caused by multiple process being
writing concurrently.
To fix this, pgpool_setup now generates startall script in which pgpool
sends stdout/stderr to cat command by pipe, and cat writes to the log
file.
- Fix to validate the PCP packet length (Muhammad Usama)
Without the validation check, a malformed PCP packet can crash the
PCP child and/or can run the server out of memory by sending the packet
with a very large data size.
- Fix a reset query stuck problem (Muhammad Usama)
The solution is to return POOL_END_WITH_FRONTEND_ERROR instead of
POOL_END when pool_flush on front-end socket fails.
The original report is
[pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL
===============================================================================
3.3.8 (tokakiboshi) 2016/02/05
* Version 3.3.8
This is a bugfix release against pgpool-II 3.3.7.
__________________________________________________________________
* Bug fixes
- doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii)
In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent
to primary node only. Pointed out in [pgpool-general-jp: 1378].
- Issue fsync() when writing pgpool_status (Tatsuo Ishii)
This ensures that pgpool_status is saved to permanent storage and
allow to survive after system crash.
- test: Fix false alarm of regression tset 062 (Yugo Nagata)
- test: Fix broken regression test for native replication (Yugo Nagata)
Test for insert lock didn't work.
- test: Fix regress test to sleep after pgpool_reload (Yugo Nagata)
Some regression tests modify configuration file and reloads. However,
sometimes these were not applied to pgpool just after reloading.
- Fix inconsistency of sequence values in replication mode (Yugo Nagata)
When a schema name was provided, the table name was quoted wrongly as
like "public.mytbl" instead of "public"."mytbl". So, pool_regclass
and to_regclass couldn't find right table oid and insert lock was
never executed. This caused inconsistency between DB nodes.
- test: Fix complication error and segfault of timestamp rewrite test
(Yugo Nagata)
- test: Add timestamp-rewrite unit test to regression test suite (Yugo Nagata)
- Fix ancient bug of pool_push() and friends (Tatsuo Ishii)
It allocates buffer using realloc and uses the pointer
returned. However it does the pointer calculation *before* realloc
gets called. So the calculation uses the old pointer value, which
causes various problems including segfault later.
Also there were other problems with it. The buffer pointer and buffer
size variable is not initialized. The buffer is not freed by
pool_close. Typo in debugging message (3.4 or later only). They are
fixed as well.
- doc: Fix wrong description about log_standby_delay in the document
(Yugo Nagata)
- test: Fix regression test 065 (Tatsuo Ishii)
The path to JDBC driver was explicitly defined. This is wrong. This
should be inherited from JDBC_DRIVER environment variable.
- test: Add option to regress.sh and pgpool_setup for unix domain socket
directory (Yugo Nagata)
- doc: Add missing descriptions about default values to documents (Yugo Nagata)
- test: Fix a bug of regress.sh option handling (Yugo Nagata)
- test: Fix regression test 055.backend_all_down to use PGSOCKET_DIR for
PostgreSQL rhel7 rpm (Yugo Nagata)
- Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii)
Pgpool-II remembers that non read only queries (including SET) were
executed in an explicit transaction and adds a "writing transaction"
mark to the transaction. The mark affects the query routing behavior
of pgpool-II while running in streaming replication mode. Pgpool-II
starts sending queries to the primary after the mark is set. Because
the effect of writing queries may appear on standbys after some delay
in streaming replication mode, it is safer to route read queries to
the primary after the mark is set.
However there's oversight here. "SET TRANSACTION READ ONLY" does no
data modification and should be treated as an exception.
Per bug #157.
- test: Fix to use timeout command to handle time out of regress test 062
(Yugo Nagata)
- test: Add missing \n in help messages (Yugo Nagata)
- test: Fix regression test 003.failover for rhel7 postgresql rpm (Yugo Nagata)
The expected result of 'show pool_nodes' is fixed to use
PGSOCKET_DIR in hostname column.
- Fix white/black_memqcache_table_list not require quotation (Yugo Nagata)
The tables and schemas name specified in *_memqcache_table_list
were needed to be quoted by double quotation.
Patch contributed by Dang Minh Huong.
Per [pgpool-hackers: 1323]
- Fix FATAL error with reloading (Tatsuo Ishii)
While reloading pgpool.conf, the number of DB nodes is tentatively set
to 0, then counted up until reaching to the actual number of backends
by the pgpool main process. Unfortunately the variable was on the
shared memory and it confused pgpool child process when they were using
the variable and this caused FATAL error.
Per bug #156 report by harukat.
- test: Add some tests for white/black_memqcache_table_list to regression
test 006.memqcache (Yugo Nagata)
- Add some warning messages for wd_authkey hash calculation failure
(Yugo Nagata)
Sometimes wd_authkey calculation fails for some reason other than
authkey mismatch. The additional messages make these distinguishable
for each other.
- test: Fix regression test to check timeout of each test (Yugo Nagata)
- test: Allow timeout value to be specified by the command option (Yugo Nagata)
- Fix bugs with data modifying WITH clause. (Tatsuo Ishii)
pgpool-II did not recognize the data modifying WITH clause despite
pgpool-II 3.3 or after has SQL parser which recognizes it. The bug has
been fixed in pgpool-II 3.5 (having PostgreSQL 9.5 parser), and the fix
is back ported to pgpool-II 3.3 and 3.4.
Per bug #153.
- Fix broken arping_cmd configuration check(Muhammad Usama)
wd_chk_setuid() function was bailing out with the NOTICE message as soon
as it finds the setuid bit is not set on any configured network command
and was ignoring the rest of configurations.
Per bug #139.
- doc: Add restriction about starting multiple pgpool simultaneously
(Yugo Nagata)
- Fix a in-memory query cache bug (Tatsuo Ishii)
If extended query protocol is used and a bind/execute message arrives
which uses a statement created by prior parse message, the temp_cache
is not initialized by a parse messages. Thus messages are added to pre
existing temp cache buffer which causes the trouble, that is, when the
cached result returns, Data Row message and Command Complete message
appeared twice.
Per by bug #152.
- Ignore close statement/portal request if they do not exist (Tatsuo Ishii)
In this case just returns a close complete message to client.
This is a back port of the following commit from pgpool-II 3.4:
1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0
- test: Fix port numbers in expected result of show pool_nodes (Yugo Nagata)
===============================================================================
3.3.7 (tokakiboshi) 2015/07/24
* Version 3.3.7
This is a bugfix release against pgpool-II 3.3.6.
__________________________________________________________________
* Bug fixes
- Fix "cannot find xlog functions" error in pgpool-recovery
(Muhammad Usama)
The argument data type of PostgreSQL's pg_xlogfile_name() function
has been changed from text to pg_lsn since PostgreSQL 9.4. And
pgpool-recovery was still trying to locate the function by old
signature.
- Pass empty string parameters in failover command when pgpool-II
does not have a value for any particular parameter (Muhammad Usama)
Instead of omitting the values for the parameters when pgpool-II does
not have any value for a particular parameter, it now passes an empty
string to the failover command. This makes sure that failover script
will always receive the exact number of expected parameters.
- doc: Clarify load balancing condition (Tatsuo Ishii)
- doc: Clarify description of pcp_promote_node (Tatsuo Ishii)
It does not actually promote PostgreSQL standby.
- doc: Fix outdated limitation description about load balancing using
JDBC driver (Tatsuo Ishii)
Even if autocommit is false, load balancing is possible in certain
conditions.
- Fix "select() system call interrupted" error (Tatsuo Ishii)
The health check process complains above and then:
ERROR: failed to make persistent db connection
DETAIL: connection to host:"x.x.x.x:5432 failed
However, the healthcheck triggers neither fail over nor retrying. So,
except the annoying messages above, everything goes well. This could
occur more easily if 1) num_init_children is big and 2) pgpool
children go into idle state (no query arrived from client for
child_life_time seconds).
Original bug report is [pgpool-general: 3756] Connection Interrupted.
Patch created by Tatsuo Ishii. Enhancement from Usama.
- Fix the case when user table includes spaces (Tatsuo Ishii)
For example if table names including spaces are used, pgpool-II cannot
be handled correctly by the internal functions which access system
catalogs and it results in SQL errors. Solution is, to always use
delimited identifier.
Per bug #136.
http://www.pgpool.net/mantisbt/view.php?id=136
Also see [pgpool-general: 3818].
- Allow to use in-memory query cache size more than 4GB (Tatsuo Ishii)
This should have been allowed since in memory query cache was born.
- Do not send a query for checking insert lock in non replication mode
with extended query (Tatsuo Ishii)
===============================================================================
3.3.6 (tokakiboshi) 2015/04/08
* Version 3.3.6
This is a bugfix release against pgpool-II 3.3.5.
__________________________________________________________________
* Bug fixes
- rpm: Fix %tmpfiles_create to not be executed in RHEL/CentOS 6
(Nozomi Anzai)
- Fix to use void * type for receiving return value of thread function
(Yugo Nagata)
Previously int type was used and this could occur stack buffer
overflow. This caused an infinity loop of ping error at bringing
up or down VIP.
- Fix to set SIGCHLD to SIG_DFL instead of SIG_IGN in watchdog processes
(Yugo Nagata)
When using waitpid, it isn't necessary to set SIGCHLD to SIG_IGN.
Rather, it is harmful, and due to this it was regarded that ping
command exited abnormally in error even when this succeeded.
- Remove an unnecessary include directive (Yugo Nagata)
- Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii)
This is used in show pool_status command and limits the length of
parameter description. Unfortunately recovery_timeout description is
64 chars, which is 1 byte longer than former definition of the macro.
- doc: Update document of condition for load balancing (Yugo Nagata)
Load balancing is possible in an explicit transaction block
even in replication mode since 3.3.0.
- Support SSL certificate chains in the certificate file for incoming
frontend connections (Muhammad Usama)
- Use to_regclass if available in time stamp rewriting in replication
mode (Tatsuo Ishii)
- Fix a hang when an error occurs in a transaction block with
replication mode (Yugo Nagata)
When an error occurs at a backend node in a transaction block with
replication mode, pgpool-II sends an invalid query to other
backends to sync transaction states. However, previously, this was
not sent to master node, and pgpool-II was waiting for master's
response forever.
- Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama)
When graceful node detach is requested gracefully, pcp_detach_node should
check if it is allowed to process detach_node command on the particular
node before blocking the incoming connections and closing the existing
connections.
- doc: Update table and flowchart of where a query should be sent to
(Yugo Nagata)
- rpm: pgpool.service is required only in RHEL/CentOS 7 (Nozomi Anzai)
===============================================================================
3.3.5 (tokakiboshi) 2015/02/05
* Version 3.3.5
This is a bugfix release against pgpool-II 3.3.4.
__________________________________________________________________
* Bug fixes
- doc: Describe explicitly that the number of slave nodes is not
necessarily 1 (Tatsuo Ishii)
- Fix occasional deadlock in failover with watchdog enabled
(Muhammad Usama)
per bug #105
http://www.pgpool.net/mantisbt/view.php?id=105
- Fix uninitialized variable (Tatsuo Ishii)
Per Coverity 1234603.
- doc: Fix missing release note entries in the previous release
(Tatsuo Ishii)
- test: Fix wait_for_pgpool_startup in pgpool_setup to use "postgres"
database rather than "test" (Tatsuo Ishii)
The test database may or may not exist and if it does not, it will
always retry until timeout expired (20 seconds), and regression test
takes unnecessary long.
- Fix possible segmentation fault in query cache (Tatsuo Ishii)
- RPM: Add to support for memcached. (Tatsuo Ishii)
- test: Allow pgpool_setup to set configuration file directory by setting
environment variable PGPOOLDIR (Tatsuo Ishii)
- RPM: Rename RPM file (Yugo Nagata)
Rename filename to include the RHEL version number like PostgreSQL's
official RPM file. (e.g. pgpool-II-pg93-3.4.0-2pgdg.rhel6.x86_64.rpm)
- Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii)
The node id should be lower than NUM_BACKENDS. Probably harmless since
callers never pass node ids greater or equal to NUM_BACKENDS.
- test: Fix failover script of pgpool_setup to use absolute path to the
database cluster (Tatsuo Ishii)
- test: Add memory leak regression test (Tatsuo Ishii)
- Fix ill signal behavior of SIGCHLD in exec_ifconfig() (Tatsuo Ishii)
For some reason SIGCHLD was set to SIG_IGN *and* tries to wait
child process which always fails because SIGCHLD is never delivered.
Due to this "ifconfig up" fails when switching to watchdog master.
See "[pgpool-general: 3310] for more details.
- Allow $_IP_$ having address prefix in if_up_cmd and if_down_cmd
(Muhammad Usama)
Previously, it is assumed that "$_IP_$" keyword will always have a
white space at the end, and when "$_IP_$" has address prefix (e.g.
$_IP_$/24), this prefix was ignored.
Per bug #122.
http://www.pgpool.net/mantisbt/view.php?id=122
- Allow "show pool_nodes" to print node ids having more than one digits
(Muhammad Usama)
Problem reported in [pgpool-general: 3374].
- Fix occasional failure in regression test '004.watchdog' (Yugo Nagata)
The patch provided by uehara in bug #127.
http://www.pgpool.net/mantisbt/view.php?id=127
- Restore SIGCHLD handler to its original after executing if_up/down_cmd
(Yugo Nagata)
Previously SIGCHLD was set to SIGIGN always after if_up/down_cmd.
This led to a incorrect error handling of ping or other commands
execution, and warning messages were output to log even when the
command exited successfully.
- RPM: Add pgpool.service for systemd in RHEL/CentOS 7 (Nozomi Anzai)
- RPM: Split pgpool_regclass and pgpool_recovery as a separate extension
package (Tatsuo Ishii)
On PostgreSQL server, only the extension package is required, no pgpool
full package is necessary.
Per Andrew N Golovkov.
- RPM: Fix wrong SSL configure option in the RPM spec file (Tatsuo Ishii)
SSL enabling option is "--with-openssl=/usr" and this is wrong. This
should be "--with-openssl".
Per bug #115.
http://www.pgpool.net/mantisbt/view.php?id=115
- RPM: Change to use systemd if it is available and adopt to PostgreSQL 9.4
(Nozomi Anzai)
- Fix to disable debug mode by reloading config (Yugo Nagata)
Per bug #114
http://www.pgpool.net/mantisbt/view.php?id=114
===============================================================================
3.3.4 (tokakiboshi) 2014/09/05
* Version 3.3.4
This is a bugfix release against pgpool-II 3.3.3.
__________________________________________________________________
* Bug fixes
- Fix a typo of pgpool.spec (Yugo Nagata)
- Fix bug that worker child process keeps failing when there's no
primary backend (Tatsuo Ishii)
Problem identified and fix contributed by Junegunn Choi.
See [pgpool-hackers: 471] for more details.
- Close listen socket when smart shutdown request is made (Tatsuo Ishii)
When smart shutdown process starts, pgpool children still listen on
the port and clients can send further connection requests which fail
in the end. Which is not only waste of time, but also prevents a load
balancer which sits in front of pgpool from realizing the pgpool is
going down.
Problem analyzed and patch provided by Junegunn Choi in [pgpool-hackers
474], and enhanced to take care not only inet domain socket but UNIX
domain socket by Tatsuo Ishii.
- doc: Add cautions that recovery commands are killed by statement_timeout
of PostgreSQL. (Tatsuo Ishii)
- test: Fix bug that wait_for_pgpool_startup does not work. (Tatsuo Ishii)
- test: Fix test driver for watchdog to use wait_for_pgpool_startup correctly
(Tatsuo Ishii)
- Fix to ignore a harmless error code when executing ifconfig command
(Yugo Nagata)
When executing command such as ifconfig or ping by execv() in a forked
child process, wait() can fails with an error code ECHILD, although the
process exists exactly, if SIGCHLD is set to SIG_IGN in Linux. We should
ignore this and not treat as failure of the command.
- test: Add undocumented "-j" option to the script comment. (Tatsuo Ishii)
- test: Fix unwanted JDBC regression test failure (Tatsuo Ishii)
- test: Fix to prevent regression test failures on slow machines
(Tatsuo Ishii)
- test: Allow to specify PostgreSQL library directory by environment
variable (Tatsuo Ishii)
- Adopt PostgreSQL 9.4 having to_regclass (Tatsuo Ishii)
PostgreSQL 9.4 has built-in function "to_regclass", which has
equivalent functionality of pgpool_regclass. Now pgpool searches
to_regclass first then try pgpool_regclass.
- Fix unportable code related to SO_REUSEPORT (Tatsuo Ishii)
There are several places using setsockopt(sock, SOL_SOCKET,
SO_REUSEPORT...). SO_REUSEPORT is not available on all Linux kernels
and the source code uses ifdef to detect the feature in the compile
time. Problem is, the binary created with kernel which provides the
feature cannot run on a kernel which does not provide the feature. Fix
is, detecting the feature in the run time by checking error code
returned by setsockopt() and ignore it if the cause of the error is
lacking the feature.
- doc: Remove old restriction description which is no longer true
(Tatsuo Ishii)
- Fix return type of text_to_lsn() function (Yugo Nagata)
This caused compile warning.
- Fix file descriptor leak when daemonize. (Tatsuo Ishii)
Per Coverity 1111471.
- Fix memory leak. (Tatsuo Ishii)
Per Coverity 1111442.
- Fix pgpool.init's long-standing bug of stop/restart failure
(Yugo Nagata)
In previous, pgpool.init uses killproc for stopping pgpool, but there
are several problems. In the new version, "pgpool -m fast stop" is
used in stop command.
Original patch contributed by Ryan DeShone and modified by Yugo Nagata.
See [pgpool-hackers: 239][pgpool-hackers: 512].
- Allow to run pgpool_setup and regression test on Ubuntu box
(Tatsuo Ishii)
- test: Fix -i option (install directory of pgpool) not working
(Tatsuo Ishii)
- Add missing include file sys/wait.h. (Tatsuo Ishii)
Per bug #104.
http://www.pgpool.net/mantisbt/view.php?id=104
- Fix an infinite loop of ping error at new active pgpool when virtual
IP switching (Yugo Nagata)
This bug also caused hangs of the old active pgpool, since this waits
response from the new active pgpool, which is in the infinite loop and
not able to respond.
This problem is reported by Qian Peng in [pgpool-hackers: 520].
- Disable statement_timeout of PostgreSQL while executing online recovery
(Tatsuo Ishii)
Online recovery may take very long time and user may enable statement
timeout. To prevent online recovery canceled by statement timeout,
disable statement timeout in the connection used by online recovery.
See [pgpool-general: 2919] for more details.
- Fix pool_table_name_to_oid in case new to_regclass used which is
introduced in PostgreSQL 9.4 (Tatsuo Ishii)
The relcache func used here should return 0 if target table is not
found. However to_regclass returns NULL in this case. To fix the
problem now COALESCE is used.
- test: Fix regression test 057 hung if run against PostgreSQL 9.4 or
later (Tatsuo Ishii)
PostgreSQL 9.4 or later changed libpq behavior: NULL username for
connection string does not cause an error, which was expected in the
test.
- Fix to close pipe when ping command exits with failure (Yugo Nagata)
This bug causes pipe open error: Too many open files, which
leads to failure of connecting to trusted servers, and then
pgpool goes to down status.
- Fix Resource leaks (Muhammad Usama)
Coverity issue #1222998 and #1222999.
- Add a description that pcp_detach_node command disconnects existing
sessions (Tatsuo Ishii)
- Fix failover.sh produced by pgpool_setup (Tatsuo Ishii)
It did not support there's more than 2 nodes case. It always tries to
promoto node0 or node1.
- Remove meaningless minus check because of unsigned int variable
(Tatsuo Ishii)
Coverity issue #1111419, #1111420, #1111422.
- replacing strcpy() with much safer and recommended call strlcpy()
(Muhammad Usama)
Coverity issue #1111480.
- Fix pgpool.spec to support openssl (Tatsuo Ishii)
- Fix pgpool.spec to use 3.3-stable tree head (Tatsuo Ishii)
- Remove unnecessary call to pool_shmem_exit() which removes semaphore
when it shouldn't (Tatsuo Ishii)
exit_handler checks if the process is parent or not. This is
good. However, even if it is a child process, it calls
pool_shmem_exit() which removes semaphore and shmem when it should
not. It should be called only from parent process.
Per bug #102.
http://www.pgpool.net/mantisbt/view.php?id=102
- Fix get_insert_command_table_name() function not to use freed pointer
(Muhammad Usama)
Coverity issue #1223007.
- Fix pool_handle_query_cache() to not free NULL pointer (Tatsuo Ishii)
- Change connect() timeout longer (10 seconds) for flaky network
(Tatsuo Ishii)
Change connect() timeout in connect_inet_domain_socket_by_port() from
1 second to 10 seconds for flaky network such as AWS. This should help
reducing frequent failover.
- Fix reset query stuck problem. (Tatsuo Ishii)
It is reported that reset query (DISCARD ALL etc.) occasionally does
not finish and pgpool child remain waiting for reply from backend thus
client cannot connect to pgpool.
The cause of problem is not identified yet but if client suddenly
closes connection to pgpool in the middle of query processing, backend
may not accept the reset queries because they are not ready for query.
The fix is, if frontend closes connection in unexpected way, query
process loop immediately returns with new state:
POOL_END_WITH_FRONTEND_ERROR and pgpool closes connection to
PostgreSQL then goes back to new connection request waiting loop.
Also, pgpool closes connections to backend when client_idle_limit is
set and the idle limit.
Per bug #107.
http://www.pgpool.net/mantisbt/view.php?id=107
- Fix other dozens of coverity issues (Muhammad Usama)
===============================================================================
3.3.3 (tokakiboshi) 2014/03/24
* Version 3.3.3
This is a bugfix release against pgpool-II 3.3.2.
__________________________________________________________________
* Bug fixes
- installer: Fix bug that install of pgpool-II RPM fails (Yugo Nagata)
- installer: Fix to set up passwordless SSH from apache@localhost to
postgres@localhost (Yugo Nagata)
- Fix bug that restarted pgpool's watchdog status is regarded as down
(Yugo Nagata)
- doc: Add mention about "listen queue" and how to increase the "backlog"
in the num_init_children section. (Tatsuo Ishii)
- Fix bug that watchdog status goes down even when only one of trusted
servers get unpingable (Yugo Nagata)
- Fix bad performance of unlogged tables detection code. (Tatsuo Ishii)
Pointed out at [pgpool-hackers: 435][[pgpool-general:2325].
- Fix primary node detection logic. (Tatsuo Ishii)
There's a possibility that primary node is not detected. This happens
in following situation. node 0: primary, node 1: standby. Node 0 goes
down. Health checking detects the fact but local status is not updated
yet. Primary node finding (find_primary_node) runs. Node 0's status is
yet healthy. Because find_primary_node fails to connect to node 0, it
immediately returns -1 and fails to find that fact that node 1 is now
primary.
Fix is just continuing to look for primary node when fails to connect
to a node.
Per [pgpool-general: 2409].
- Add raw mode support to pgpool_setup. (Tatsuo Ishii)
- test: Integrate jdbc test to regression test. (Tatsuo Ishii)
- Fix jdbc DML fails when operated in raw mode and auto commit is off.
(Tatsuo Ishii)
This is reported in bug #92.
- Fix to output error message when wd_escalation_command fails with exit
code other than 0 (Yugo Nagata)
This is suggested by Sergey Arlashin in [pgpool-general: 2457].
- test: Add new regression test for query cache. (Tatsuo Ishii)
- Fix query cache bug with extended protocol. (Tatsuo Ishii)
SELECT retrieves outdated cache even DML was executed in an explicit
transaction. The bug had been there since in memory query cache was
born. Per [pgpool-general-jp: 1252].
- Add missing entries "relcache_size" and "check_temp_table" to show
pool_status (Tatsuo Ishii)
- Fix to output error message when if_up_cmd fails. (Yugo Nagata)
This is suggested by Sergey Arlashin in [pgpool-general: 2457].
- Avoid to send queries to unrelated nodes in streaming replication mode.
(Tatsuo Ishii)
Pgpool-II sends certain queries, such as BEGIN, END and SET commands to
all of DB nodes. However in streaming replication mode, only primary
node and at most one standby node are only concerned (if primacy node
is selected as the load balance node, only 1 node is concerned).
See [pgpool-hackers: 464] for more details.
- Fix possible buffer overrun problem and memory leak. (Tatsuo Ishii)
Per Coverity 1111465 and 1111482.
- Fix possible buffer overrun. (Tatsuo Ishii)
Replace strcpy() with strlcpy(). Per Coverity report 1111478, 1111480,
1111481.
- Add debug messages for analyzing errors in if_up_cmd (Yugo Nagata)
- Fix freeing NULL. (Tatsuo Ishii)
Per Coverity 1111384.
- Do not enable query cache on materialized views. (Tatsuo Ishii)
Per bug #95.
- Fix memory leak. (Tatsuo Ishii)
Per Coverity 1111446.
- Fix a segmentation fault in parallel mode with system_db_hostname is
empty (Yugo Nagata)
- Fix to output debug messages in processing pgpool.conf with -d option
(Yugo Nagata)
Previously, some debug messages in pool_get_config() ware not output
even when -d option was used.
- Fix JDBC exception of prepared statement including now() in
replication mode (Yugo Nagata)
With JDBC, when a prepared statement is executed more than
PrepareThreshold times, the statement is named and Describe message
is sent after Parse. With named statement, pgpool rewrite now() to
parameter in replication mode. Hence, rewritten query has additional
parameter than original. In this case, ParameterDescription message
sent to frontend (response of Describe) should include OIDs of the
same number os original query's parameters. Otherwize, JDBC throws
ArrayIndexoutOfBoundsException.
This is reported in [pgpool-general-jp: 1192].
- Fix backend error of prepared statement about table which has column whose
default value is now() in replication mode (Yugo Nagata)
When pgpool parses a named prepared statement with default now(),
timestamps are replaced to additional parameters. So, Bind message also
should included additional parameter format codes. However, when the
number of original parameter was one, pgpool didn't handle this. This
caused a error like "incorrect binary data format in bind parameter 2".
- test: Fix a bug of regression test of JDBC that shows OK even when
this fails (Yugo Nagata)
- test: Add a new regression test for JDBC's PrepareThreshold (Yugo Nagata)
- doc: Add description about parallel mode doesn't support PREPARE (Yugo Nagata)
Per bug #93
===============================================================================
3.3.2 (tokakiboshi) 2013/11/29
* Version 3.3.2
This is a bugfix release against pgpool-II 3.3.1.
__________________________________________________________________
* Bug fixes
- Fix incorrect time stamp rewriting in replication mode for certain time
zones. (Tatsuo Ishii)
Time stamp rewriting calls "SELECT now()" to get current time.
Unfortunately the buffer for the current time is too small for certain
time zones such as "02:30". Note that non-30-minutes-time-zone such as
"0900" does not reveal the problem. This explains why we haven't the bug
report until today.
Bug reported in [pgpool-general: 2113] and fix provided by Sean Hogan.
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002142.html
- installer: Fix the way to specify pgpoolAdmin version in
redhat/rpm_installer/getsources.sh. (Yugo Nagata)
- Makefile: Replace pg_config by $(PG_CONFIG) in Makefiles so it can be
overridden at build time when compiling for different PG major versions.
(Tatsuo Ishii)
Patch contributed by Christoph Berg ([pgpool-general: 2127]).
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html
- watchdog: Fix a warning/error when compiling with -Werror=format-security.
(Tatsuo Ishii)
Patch contributed by Christoph Berg ([pgpool-general: 2127]).
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html
- configure: Remove -lcompat because it confuses FreeBSD per bug#15.
(Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=15
- Fix segfault when pgpool.conf does not set log_standby_delay.
(Tatsuo Ishii)
This is caused by wrong initialization for log_standby_delay in
pool_config.l.
Per bug#74. http://www.pgpool.net/mantisbt/view.php?id=74
- doc: Modify descriptions about restrictions of parallel mode
Multiple rows INSERT using VALUES are not supported in parallel mode.
(Yugo Nagata)
- Avoid calling find_primary_node_repeatedly() when standby node goes
down. (Tatsuo Ishii)
This will reduce the time to failover. Per bug #75, patch modified by
Tatsuo Ishii. http://www.pgpool.net/mantisbt/view.php?id=75
- Fix data inconsistency problem with native replication mode + extended
protocol case. (Tatsuo Ishii)
It is reported that concurrent INSERT using JDBC driver causes data
difference among database node. This only happens following conditions
are all met:
1) Native replication mode
2) Extended protocol used
3) The portal created by parse message is reused by bind message
4) autocommit is on
5) SERIAL (sequence) is used
Pgpool-II's parse message function knows it has to lock the target
table when INSERT (plus #5) is issued by clients. Unfortunately bind
message function did not know it. Once parse/bind/execute finishes,
pgpool releases the lock obtained by parse because of #4. JDBC wants
to reuse the portal and starts the cycle from bind message, which does
not obtain lock. As as result, lock-free INSERT are floating around
which causes data inconsistency of course. The solution is, lock the
table in bind phase.
For this bind needs to issue LOCK in extended protocol. This was a little
bit hard because the module (do_command()) to issue internal SQL command
(other than SELECT) does not support extended protocol.
To solve the problem do_query() is modified so that it accepts other than
SELECT because it already accepts extended protocol.
The modification is minimum and is only tested for the case called from
insert_lock(). I do not recommend to replace every occurrence of
do_command () with do_query() at this point.
BTW the reason why the bug is not reported is, most users uses JDBC
with auto commit = off. In this case, the lock obtained by parse persists
until user explicitly issues commit or rollback.
Per bug report by Steve Kuekes in [pgpool-general: 2142].
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002171.html
- Fix memory allocation size bug in the code path of query cache.
(Tatsuo Ishii)
In execute() memory allocation size is too small incertain case. No bug
has been reported so far, but certainly this is a bug.
- Fix occasional segfault in query cache + extended protocol.
(Tatsuo Ishii)
When the query is not "cache safe", bind_msg->param_offset was not set
in Bind(). However, Execute() unconditionally uses bind_msg->param_offset
to convert bind parameters to string so that they can be added to the
cached query string and it causes segfault because bind_msg->param_offset
is a garbage. Also logic bug to calculate bind_msg->param_offset is
corrected.
Per bug#76. http://www.pgpool.net/mantisbt/view.php?id=76
- Avoid to run out free query cache hash index entry. (Tatsuo Ishii)
If hash index entries are run out, pgpool-II cannot reuse old cache
entry because pgpool-II always expects there's at least one empty hash
index entry. To mitigate the problem, if free hash index entries are run
out, look for victim cache block to reuse the hash index entry.
Per bug #70. http://www.pgpool.net/mantisbt/view.php?id=70
- installer: checkEnv() didn't do anything and always returned 0.
(Nozomi Anzai)
- Fix inappropriate shared memory allocation size for clock hand.
(Tatsuo Ishii)
The memory for clock hand was allocated as sizeof(pool_fsmm_clock_hand))
which is 8 bytes long because the variable is declared as:
static int *pool_fsmm_clock_hand;
This is plain wrong. The memory size actually needed is only 4 bytes,
which is sizeof(*pool_fsmm_clock_hand)). In other word, the bug allocated
unnecessary 4 bytes, which did nothing bd for the execution of program.
But a bug is a bug.
Per coverity report "1111476 Wrong sizeof argument"
- Fix "show pool_status" always shows memqcache_auto_cache_invalidation as
0. (Tatsuo Ishii)
Per bug #80. http://www.pgpool.net/mantisbt/view.php?id=80
- Fix error message in read_password_packet(). (Tatsuo Ishii)
- watchdog: Fix to pass big parameter by pointer instead of by value at
some function. (Yugo Nagata)
- Fix memory leak when SSL is requested. (Tatsuo Ishii)
When SSL is requested, pgpool child retries to read start up packet.
However it does not free the memory for previous start up packet.
Per Coverity report "1111443 Resource".
- Fix memory leak when do_query() fails in timestamp rewriting.
(Tatsuo Ishii)
For this purpose free_select_result() is changed to accept NULL argument.
Per Coverity report "1111454, 1111455 Resource leak".
- Fix load balance bug in replication mode. (Tatsuo Ishii)
When load_balance_mode = off, SELECTs including writing function
should be sent to all the DB nodes. Per [pgpool-general: 2221].
http://www.sraoss.jp/pipermail/pgpool-general/2013-October/002250.html
The bug was introduced in:
http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=1ac45a28258074ea4d9d902aca016f970d31f311
(3.3.1).
- watchdog: Fix to put null character at end of ping result string used in
watchdog. (Yugo Nagata)
- Fix target node selection logic when "DEALLOCATE portal|statement".
(Tatsuo Ishii)
When "DEALLOCATE portal|statement" is used and last prepared statement or
portal was not found, target node selection map is not set. Probably this
is not actually harmful because prepared statement or portal was not found
is an error case. The bug was there since day 0.
Per Coverity report "1111491 Structurally dead code".
- Fix range check bug of MAX_NUM_BACKENDS in corner case. (Tatsuo Ishii)
MAX_NUM_BACKENDS is the allowed max number of DB nodes (128, at this
point). In reality, probably no one ever tried more than 128 DB nodes
and that's the reason why nobody noticed.
Per Coverity report "1111429, 1111430 and 1111431 Out-of-bounds write".
- Do not set/unset fronted connection info for dead backend. (Tatsuo Ishii)
Per bug #82. http://www.pgpool.net/mantisbt/view.php?id=82
- Fix that the script forgets to allow public access to pgpool_catalog.
(Tatsuo Ishii)
The bug prevents inserting data into user tables if pgpool_catalog is
created in native replication mode. The bug was there from day 1. I
wonder why nobody noticed until today.
Per [pgpool-general-jp: 1229].
http://www.sraoss.jp/pipermail/pgpool-general-jp/2013-November/001228.html
- doc: Add description that it is recommended to specify multiple servers
to trusted_servers. (Yugo Nagata)
- Fix uninitialized variable in error case in pool_do_auth().
(Tatsuo Ishii)
If there's no valid backend, pgpool will return garbage pid to frontend in
auth phase. Actually because no backend is available, frontend will be
disconnected later on. So this is harmless.
Per Coverity report "1127331 Uninitialized scalar variable".
- Fix to add node id range check when issue an error message using node
id. (Tatsuo Ishii)
Per Coverity report #1111433 "Out-of-bounds read".
- Fix buffer overrun bug and resource leak bug of parse_copy_data().
(Tatsuo Ishii)
Per Coverity report 1111427 "Out-of-bounds write" and 1111453 "Resource
leak".
- Fix possible segfault in CopyDataRaws(). (Tatsuo Ishii)
Coverity pointed out that if pool_get_id() returns an error, VALID_BACKEND
will access out of array.
Per Coverity report 1111413 "Memory - illegal accesses".
- Fix query cache is enabled and protocol version = 2 case. (Tatsuo Ishii)
When the protocol version = 2, we assume that session state is "idle".
This is not feasible but no way. I recommend to not use query cache
with protocol 2.
Per Coverity report 1111488 "Uninitialized scalar variable".
- Fix strftime() usage in pool_pools(). (Tatsuo Ishii)
The buffer is not large enough as expected by the second parameter. This
is not harmless because the format string will not produce longer result
string than the buffer.
Per Coverity report 1111426 "Out-of-bounds access".
- RPM: Improved to specify the versions of pgpool-II and PostgreSQL in the.
spec file. (Nozomi Anzai)
- Fix resource leak in make_persistent_db_connection. (Tatsuo Ishii)
For this purpose, new static function free_persisten_db_connection_memory
is added.
Per Coverity report #1111468.
- Fix a bug that connection check to trusted servers fails when the RTT
is very short. (Yugo Nagata)
- Fix several small bug fixes detected by Coverity. (Tatsuo Ishii)
===============================================================================
3.3.1 (tokakiboshi) 2013/09/06
* Version 3.3.1
This is a bugfix release against pgpool-II 3.3.0.
__________________________________________________________________
* Bug fixes
- Fix to add the regression test suite for making tar boll (Tatsuo Ishii)
This isn't included in the tar ball of 3.3.0 release.
- Fix watchdog test script in regression test (Tatsuo Ishii)
- Fix a memory overrun bug (Tatsuo Ishii)
This problem is pointed out in [pgpool-general: 1956] by Sean Hogan.
[pgpool-general: 1956] memory overrun bug?
http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001984.html
- Fix a compile error (Yugo Nagata)
- Fix child process termination with sig abort when memory query cache
is enabled (Tatsuo Ishii)
This is due to double free bug that occurs when multiple bind/execute
messages come after a parse message. When a parse messages comes, query
context is created along with temp cache. The pointer to the temp cache
is added to the temp cache array when the query executed. Subsequent
bind messages uses the same temp cache pointer. This is the source of
double free bug when the cache array discarded.
This is reported in Bug track #68 by harukat.
#68: child process termination with sigabort when memory_cache_enabled = on
http://www.pgpool.net/mantisbt/view.php?id=68
- Add some test cases to regression test (Tatsuo Ishii)
- Fix typos of the document in installation of pgpool-recovery section.
(Tatsuo Ishii)
- Fix a typo of log message (Yugo Nagata)
- Fix typos of the japanese document (Yugo Nagata)
- Fix to send SELECT to master node only when load_balance_mode is off
in replication mode (Tatsuo Ishii)
When load_balance_mode is off in replication mode, SELECT queries
should be sent to master node only, rather than sent to all nodes in
an explicit transaction.
This problem is reported in [pgpool-general: 2038] by Rypl Lukas.
[pgpool-general: 2038] SELECT sent to both nodes in replication mode
http://www.sraoss.jp/pipermail/pgpool-general/2013-August/002066.html
- Fix pgpool_setup to work in standalone. (Tatsuo Ishii)
===============================================================================
3.3.0 (tokakiboshi) 2013/07/30
* Version 3.3.0
This is the first version of pgpool-II 3.3 series.
That is, a "major version up" from 3.2 series.
__________________________________________________________________
* Incompatible changes
- All the following are about watchdog.
See "New features" section below for details of these changes.
- Default monitoring method was changed from query mode to heartbeat mode.
- Failover/failback commands are executed in only one pgpool-II.
- In default, all the query caches on shared memory are cleared when
standby pgpool-II escalates to active.
- Database name, user name, and password used for monitoring other
pgpool-II by query are specified by dedicated parameters.
Previously, template1, recovery_user, and recovery_password are used.
__________________________________________________________________
* New features
** Watchdog
- Add a new monitoring method using heartbeat signal of UDP packet in
lifecheck. (Yugo Nagata)
You can select a method from either of two methods, "heartbeat" mode or
"query" mode.
The heartbeat mode is the new method. In this mode, watchdog monitors
other pgpool-II process by using heartbeat signal. Watchdog receives
heartbeat signals sent by other pgpool-II periodically. If there are no
signal for a certain period, watchdog regards it as failure of the
pgpool-II. For redundancy you can use multiple networks for heartbeat
exchange between pgpool-IIs. This mode is default and recommended one.
The query mode is the conventional method. In this mode, watchdog monitors
pgpool-II's service rather than process. Watchdog sends queries to other
pgpool-II and checks the response. Note that this method requires connections
from other pgpool-IIs, so it would fail motoring if num_init_children isn't
large enough. This mode is deprecated and left for backward compatibility.
Add these new parameters:
- wd_lifecheck_method
- wd_heartbeat_port
- wd_heartbeat_keepalive
- wd_heartbeat_deadtime
- heartbeat_destinationX
- heartbeat_destination_portX
- heartbeat_deviceX
- Add interlocking mechanism of exclusive failover/failback command
execution. (Yugo Nagata)
When using multiple pgpool-IIs with watchdog enabled, failover commands
(failover_command, failback_command, and follow_master_command) get
executed only at one pgpool-II.
Previously, these command got executed at all pgpool-IIs.
- Add authentication mechanism for watchdog packet communication.
(Yugo Nagata)
Watchdog packets (include heartbeat signal) from pgpool-II with wrong
authentication key are rejected. All pgpool-IIs must have the same key,
which is specified wd_authkey parameter in pgpool.conf. pgpool-II with
wrong authkey can't even start watchdog, because the startup packet is
rejected by other pgpool-IIs.
- Add clear_memqcache_on_escalation parameter. (Yugo Nagata)
If this is on, all the query caches on shared memory are cleared when
standby pgpool-II escalates to active.
This is aimed to prevent the new active pgpool-II from using inconsistent
query caches with the previous active.
- Add wd_escalation_command parameter. (Yugo Nagata)
This specifies command which is executed at escalation on the new active
pgpool-II server. The timing is just before virtual IP is brought up.
- Add parameters wd_lifecheck_dbname, wd_lifecheck_user, and
wd_lifecheck_password. (Yugo Nagata)
These parameters specify the database name, the user name, and password
used in query mode lifecheck of watchdog . Previously, these are hard
coded to use template1, recovery_user, and recovery_password.
- When delegate_IP parameter is empty, virtual IP is neither brought up
nor switched. (Yugo Nagata)
This allows multi-master like configuration without virtual IP.
- Add pcp_watchdog_info command (Yugo Nagata)
This is PCP command for retrieving the watchdog status.
** Others
- Import PostgreSQL 9.2 raw parser. (Nozomi Anzai, Tatsuo Ishii)
- Add a tool called pgpool_setup to set up pgpool-II and PostgreSQL
temporary installation in current directory for *testing* purpose.
(Tatsuo Ishii)
usage: pgpool_setup [-m r|s][-n num_clusters][--no-stop]
-m s: create an installation as streaming replication mode.
(the default)
-m r: create an installation as native replication mode.
-n num_clusters: create num_clusters PostgreSQL database cluster nodes
-p base_port: specify base port. The first PostgreSQL node's port is
base_port. Second PostgreSQL node's port is base_port+1
... nth PostgreSQL node's port is base_port+n-1, pgpool
port is base_port+n, pcp port is base_port+n+1.
--no-stop: do not stop pgpool and PostgreSQL after the work
- Support installation method using CREATE EXTENSION for pgpool-recovery
and pgpool-regclass. (Tatsuo Ishii)
Older installation method is still preserved.
Note: extension names are "pgpool_recovery" and "pgpool_regclass", not
"pgpool-recovery" and "pgpool-regclass" because letters are not
convenient in using CREATE EXTENSION command (requires double quotes).
- Add a function "pgpool_pgctl()" which enables to execute
pg_ctl stop/restart/reload (except for start) by SQL. (Nozomi Anzai)
$ psql sales -c "select pgpool_pgctl('reload', 'fast')";
pgpool_pgctl
--------------
t
(1 row)
This function always ignores the actual result and returns 't', so the
user can't know if pg_ctl succeeded or failed. To use this we have to set
the custom variable for security which limits the users to execute pg_ctl
who has the permission of data directory.
- Add shell scripts to install pgpool-II and pgpoolAdmin by RPM.
(Nozomi Anzai, Yugo Nagata)
To make the installer package execute getsources.sh, and the directory
named "work" will be created. And you rpmbuild each spec files in work/,
put RPMs into work/installer and make tar ball of work/installer.
The installer does not only install RPMs but also edit postgresql.conf,
pgpool.conf, pg_hba.conf, recovery.conf and scripts for failover and
online recovery.
This assumes two-nodes configuration and the install script have to be
executed in both nodes.
- Add new parameter "search_primary_node_timeout".
(Muhammad Usama, Tatsuo Ishii)
The parameter specifies the maximum amount of time in seconds to
search for a primary node when a failover scenario occurs. Patch
contributed by Muhammad Usama. Japanese doc and slight editing of
English doc by Tatsuo Ishii.
- Chinese tutorials for memqcache and watchdog. (Bambo Huang)
- Add regression test suit. (Tatsuo Ishii)
__________________________________________________________________
* Bug fixes
- Consider timeout waiting for completion of failback request in on line
recovery. (Tatsuo Ishii)
This will prevent the situation that recovery operation continues forever
and we cannot even shutdown pgpool-II main process. This could happen
especially while executing follow master command.
- Fix a bug that %H of follow_master_command is not assigned correctly the
new primary node in stream replication mode.
(Tatsuo Ishii)
- Fix not to execute escalation when the pgpool-II which is already active
receives down notification from other pgpool-II. (Yugo Nagata)
- Fix wd_create_send_socket() not to execute select() before connect().
(Yugo Nagata)
How select() works on an unconnected socket is undefined, and differs
between platform. On Linux, this returns 2 and it is eventually harmless.
However, on Soraris, this returns 0 and it is indistinguishable from time
timeout, so watchdog wouldn't work correctly.
- Fix error when pgpool_regclass is not installed. (Tatsuo Ishii)
The query used in pool_has_pgpool_regclass() fails if pgpool_regclass
does not exist. The bug was introduced in 3.2.4. See [pgpool-general:
1722] for more details.
[pgpool-general: 1722] [PgPool-II 3.2.4] pgpool_regclass now mandatory?
http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001749.html
- Fix do_query() not to hang when PostgreSQL returns an error.
(Tatsuo Ishii)
The typical symptom is "I see SELECT is keep on running according to
pg_stat_activity". To fix this pgpool-II just exits the process and
kill the existing connection. This is not gentle but at this point I
believe this is the best solution.
- Fix possible deadlock during failover with watchdog enabled.
(Yugo Nagata)
This is reported in Bug track #54 by arshu arora
http://www.pgpool.net/mantisbt/view.php?id=54
- Fix unnecessary degeneration caused by error on commit. (Tatsuo Ishii)
In master slave mode, if master gets an error at commit, while other
slaves are normal at commit, we don't need to degenerate any backend
because it is likely that the "kind mismatch error" was caused by a
deferred trigger.
- Fix bug with do_query which causes hung in extended protocol.
(Tatsuo Ishii)
This problem could occur when insert lock is enabled and
pgpool_catalog.insert_lock exists, See [pgpool-general: 1684] for more
details.
[pgpool-general: 1684] insert_lock hangs
http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001711.html
- Fix possible failure of query cache invalidation for DML in transaction.
(Tatsuo Ishii)
CREATE TABLE t1(i INTEGER);
CREATE TABLE t2(i INTEGER);
SELECT * FROM t1;
BEGIN;
DELETE FROM t2 WHERE i = 0;
INSERT INTO t1(i) VALUES(1);
COMMIT;
SELECT * FROM t1;
At commit pgpool tries to delete cache for t2 but fails because
there's no oid table entry for t2. Problem is, it fails to check oid
table for t1. So cache for t1 remains and the last SELECT incorrectly
returns cached data. Fix is, continuing to check oid table entries.
This is reported in Bug track #58 by wms
http://www.pgpool.net/mantisbt/view.php?id=58
- Fix to register pgpool_regclass in pg_catalog schema (Tatsuo Ishii)
This is necessary to deal with clients which restricts schema search path
to pg_catalog only. Postgres_fdw is such a client.
- Fix a hang of "pgpool -m f stop" (Tatsuo Ishii)
This is caused by unmanaged pgpool children remaining. This could happen
when multiple PostgreSQLs are going down or even when pgpool is started
before PostgreSQL startup.
- Fix a potential crash in pg_md5 command (Muhammad Usama)
- Fix a segmentation fault that occurs when on memory query cache enabled
and the query is issued in extended query mode and the result is too large
(Tatsuo Ishii)
This is reported in Bug track #63 by harukat.
Analysis and a test case are also provided.
#63 Child process was terminated by segmentation fault with memcached
http://www.pgpool.net/mantisbt/view.php?id=63
- Fix a segmentation fault of a child process that occurs when a startup
packet has no PostgreSQL user information (Yugo Nagata)
You can reproduce it by
$ psql -p 9999 -U ''
If enable_pool_hba is on, a child process terminates by segmentation
fault. Otherwise if enable_pool_hba is off, the error message is
ERROR: pool_discard_cp: cannot get connection pool for user (null)
database (null)
In both cases, psql terminates with no message on frontend.
In the fixed version, if PostgreSQL user is not specified in startup packet,
the message as following is output to both log and frontend. This is
the same behavior as PostgreSQL.
FATAL: no PostgreSQL user name specified in startup packet
- Fix memory allocation logic in extended query processing with on-memory
query cache enabled (Tatsuo Ishii)
When very long query string (> 1024 bytes) supplied in extended query
with bind parameters, it fails to allocate enough memory.
- Fix to verify the backend node number in pcp_recovery_node (Yugo Nagata)
When an invalid number is used, null value is passed as an arguments
of recovery script, and this causes a malfunction. In especially,
rsync may delete unrelated files in basebackup scripts.
- Fix a segmentation fault on main process that could occurs after backend
error detection (Tatsuo Ishii)
This is reported in Bug track #62 by tuomas.
#62 Slave network outage causes a segmentation fault on main process
http://www.pgpool.net/mantisbt/view.php?id=62
- Fix bug with health check when used with child_life_time (Tatsuo Ishii)
Failover could happen even if the backend was running fine.
This problem is reported in [pgpool-general: 1892] by larisa sabban.
[pgpool-general: 1892] Pgpool is unable to connect backend PostgreSQL
http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001920.html
- Fix bug in parsing prepared statements with transaction handling in
replication mode (Tatsuo Ishii)
Parse() automatically starts a transaction for non SELECT query to keep
consistency among nodes in replication mode. But this wasn't closed. If
wrong query comes in, the transaction goes into an abort state but pgpool
does not close the transaction. Thus next query causes error because the
transaction is still in abort status.
This problem was reported in [pgpool-general: 1877] by Sean Hogan.
[pgpool-general: 1877] current transaction is aborted, commands ignored
http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001905.html
__________________________________________________________________
* Enhancements
- Add mention about "-D" option to the man page.
(Tatsuo Ishii)
- Fix to restart watchdog processes automatically when these exit abnormally.
(Yugo Nagata)
- Add more error checks and reportings to functions executing ping command
with watchdog enabled. (Tatsuo Ishii)
- Replace some unsafe functions, sprintf and strncpy, with more safe ones,
snprintf and strlcpy respectively. (Yugo Nagata)
- Replace "sticky bit" to "setuid bit" in log message, comments and
function names. (Yugo Nagata)
These words were used mistakenly and caused confusion.
- Fix description on SSL in pool_hba.conf.sample. (Tatsuo Ishii)
- Allow to load balancing in an explicit transaction in replication mode.
(Tatsuo Ishii)
The condition to allow the load balancing is as follows:
1) replicate_select is off
2) no writing functions are used
3) transaction isolation level is not serializable
4) no DML/DDL are issued in the transaction
- Chinese manual is updated to the latest especially about watchdog. (Bambo Huang)
- Add mention about "-D" option to the man page. (Tatsuo Ishii)
- Move ssl_ca_cert and ssl_ca_cert_dir descriptions to the SSL section
in the document (Yugo Nagata)
- Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document
(Yugo Nagata)
===============================================================================
3.2 Series (2012/08/03 - )
===============================================================================
3.2.17 (namameboshi) 2016/08/31
* Version 3.2.17
This is a bugfix release against pgpool-II 3.2.16.
__________________________________________________________________
* Bug fixes
- Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii)
While processing "show pool_nodes", the buffer for hostname was too
short. It should be same size as the buffer used for pgpool.conf.
Problem reported by a twitter user who is using pgpool on AWS (which
could have very long hostname).
- Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii)
The usage of wait(2) in pgpool main could cause infinite wait in the
system call. Solution is, to use waitpid(2) instead of wait(2).
- Fix "kind mismatch" error message in pgpool. (Muhammad Usama)
Many of "kind mismatch..." errors are caused by notice/warning
messages produced by one or more of the DB nodes. In this case now
Pgpool-II forwards the messages to frontend, rather than throwing the
"kind mismatch..." error. This would reduce the chance of "kind
mismatch..." errors.
See [pgpool-hackers: 1501] for more details.
- Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii)
The macro calls pool_virtual_master_db_node_id() and then access
backend->slots[id]->con using the node id returned. In rare cases, it
could point to 0 (in case when the DB node is not connected), which
gives access to con->major, then it causes a segfault.
See bug 225 for related info.
- doc : fix Japanese document typo. (Bo Peng)
- Fixing a typo in the log message. (Muhammad Usama)
- doc : Add comment to the document about connection_cache. (Tatsuo Ishii)
===============================================================================
3.2.16 (namameboshi) 2016/06/17
* Version 3.2.16
This is a bugfix release against pgpool-II 3.2.15.
__________________________________________________________________
* New features
- Allow to access to pgpool while doing health checking (Tatsuo Ishii)
Currently any attempt to connect to pgpool fails if pgpool is doing
health check against failed node even if fail_over_on_backend_error is
off because pgpool child first tries to connect to all backend
including the failed one and exits if it fails to connect to a backend
(of course it fails). This is a temporary situation and will be
resolved before pgpool executes failover. However if the health check
is retrying, the temporary situation keeps longer depending on the
setting of health_check_max_retries and health_check_retry_delay. This
is not good. Attached patch tries to mitigate the problem:
- When an attempt to connect to backend fails, give up connecting to
the failed node and skip to other node, rather than exiting the
process if operating in streaming replication mode and the node is
not primary node.
- Mark the local status of the failed node to "down".
- This will let the primary node be selected as a load balance node
and every queries will be sent to the primary node. If there's other
healthy standby nodes, one of them will be chosen as the load
balance node.
- After the session is over, the child process will suicide to not
retain the local status.
* Bug fixes
- Fix is_set_transaction_serializable() when
SET default_transaction_isolation TO 'serializable'. (Bo Peng)
SET default_transaction_isolation TO 'serializable' is sent to
not only primary but also to standby server in streaming replication mode,
and this causes an error. Fix is, in streaming replication mode,
SET default_transaction_isolation TO 'serializable' is sent only to the
primary server.
See bug 191 for related info.
- Fix Chinese documentation bug about raw mode (Yugo Nagata, Bo Peng)
Connection pool is available in raw mode.
- Fix confusing comments in pgpool.conf (Tatsuo Ishii)
- Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama)
Currently TLSv1_method() is used to initialize the SSL context, that puts an
unnecessary limitation to allow only TLSv1 protocol for SSL communication.
While postgreSQL supports other ciphers protocols as well. The commit changes
the above and initializes the SSLSession using the SSLv23_method()
(same is also used by PostgreSQL). Because it can negotiate the use of the
highest mutually supported protocol version and remove the limitation of one
specific protocol version.
- If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii)
query to primary node, and all of following user queries are sent to
standby, it is possible that the next command, for example END, could
cause a statement timeout error on the primary, and a kind mismatch
error on pgpool-II is raised.
This fix tries to mitigate the problem by sending sync message instead
of flush message in do_query(), expecting that the sync message reset
the statement timeout timer if we are in an explicit transaction. We
cannot use this technique for implicit transaction case, because the
sync message removes the unnamed portal if there's any.
Plus, pg_stat_statement will no longer show the query issued by
do_query() as "running".
See bug 194 for related info.
- Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if
primary is not node 0, then statement timeout could occur even after
bug194-3.3.diff was applied. After some investigation, it appeared
that MASTER macro could return other than primary or load balance
node, which was not supposed to happen, thus do_query() sends queries
to wrong node (this is not clear from the report but I confirmed it in
my investigation).
pool_virtual_master_db_node_id(), which is called in MASTER macro
returns query_context->virtual_master_node_id if query context
exists. This could return wrong node if the variable has not been set
yet. To fix this, the function is modified: if the variable is not
either load balance node or primary node, the primary node id is
returned.
- change the Makefile under the directory src/sql/, that is proposed (Bo Peng)
by [pgpool-hackers: 1611]
- Fix a possible hang during health checking (Yugo Nagata)
Health checking was hang when any data wasn't sent
from backend after connect(2) succeeded. To fix this,
pool_check_fd() returns 1 when select(2) exits with
EINTR due to SIGALRM while health checking is performed.
Reported and patch provided by harukat and some modification
by Yugo. Per bug #204.
backported from 3.4 or later;
https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=ed9f2900f1b611f5cfd52e8f758c3616861e60c0
- Fix bug with load balance node id info on shmem (Tatsuo Ishii)
There are few places where the load balance node was mistakenly put on
wrong place. It should be placed on: ConnectionInfo *con_info[child
id, connection pool_id, backend id].load_balancing_node]. In fact it
was placed on: *con_info[child id, connection pool_id,
0].load_balancing_node].
As long as the backend id in question is 0, it is ok. However while
testing pgpool-II 3.6's enhancement regarding failover, if primary
node is 1 (which is the load balance node) and standby is 0, a client
connecting to node 1 is disconnected when failover happens on node
0. This is unexpected and the bug was revealed.
It seems the bug was there since long time ago but it had not found
until today by the reason above.
===============================================================================
3.2.15 (namameboshi) 2016/04/26
* Version 3.2.15
This is a bugfix release against pgpool-II 3.2.14.
__________________________________________________________________
* Bug fixes
- Removing the limit on the maximum number of items in the
black_function_list and white_function_list lists. (Muhammad Usama)
extract_string_tokens in pool_config uses the fixed size malloc on
the array to hold the black_function_list/white_function_list items.
This imposes a limit of maximum items in these lists.
The fix is to use realloc to increase the array size when it gets full.
- Redirect all user queries to primary server (Tatsuo Ishii)
Up to now some user queries are sent to other than the primary server
even if load_balance_mode = off. This commit changes the behavior: if
load_balance_mode = off in streaming replication mode, now all the
user queries are sent to the primary server only.
Per bug #189.
- Change the PID length of pcp_proc_count command result to 6 characters
long (Bo Peng)
If the pgpool process ID are over 5 characters, the 6th character of each
process ID will be removed. This commit changes the process ID length of
pcp_proc_count command result to 6 characters long.
Per bug #188.
===============================================================================
3.2.14 (namameboshi) 2016/04/04
* Version 3.2.14
This is a bugfix release against pgpool-II 3.2.13.
__________________________________________________________________
* Bug fixes
- doc: Change description of backend_flag (Tatsuo Ishii)
It is pointed out that restarting pgpool-II is not necessary.
Per [pgpool-general-jp: 1394].
- doc: Fix installation procedure. (Tatsuo Ishii)
With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed.
- Fix to validate the PCP packet length (Muhammad Usama)
Without the validation check, a malformed PCP packet can crash the
PCP child and/or can run the server out of memory by sending the packet
with a very large data size.
- Fix a reset query stuck problem (Muhammad Usama)
The solution is to return POOL_END_WITH_FRONTEND_ERROR instead of
POOL_END when pool_flush on front-end socket fails.
The original report is
[pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL
===============================================================================
3.2.13 (namameboshi) 2016/02/05
* Version 3.2.13
This is a bugfix release against pgpool-II 3.2.12.
__________________________________________________________________
* Bug fixes
- doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii)
In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent
to primary node only. Pointed out in [pgpool-general-jp: 1378].
- Issue fsync() when writing pgpool_status (Tatsuo Ishii)
This ensures that pgpool_status is saved to permanent storage and
allow to survive after system crash.
- Fix ancient bug of pool_push() and friends (Tatsuo Ishii)
It allocates buffer using realloc and uses the pointer
returned. However it does the pointer calculation *before* realloc
gets called. So the calculation uses the old pointer value, which
causes various problems including segfault later.
Also there were other problems with it. The buffer pointer and buffer
size variable is not initialized. The buffer is not freed by
pool_close. Typo in debugging message (3.4 or later only). They are
fixed as well.
- doc: Fix wrong description about log_standby_delay in the document
(Yugo Nagata)
- Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii)
Pgpool-II remembers that non read only queries (including SET) were
executed in an explicit transaction and adds a "writing transaction"
mark to the transaction. The mark affects the query routing behavior
of pgpool-II while running in streaming replication mode. Pgpool-II
starts sending queries to the primary after the mark is set. Because
the effect of writing queries may appear on standbys after some delay
in streaming replication mode, it is safer to route read queries to
the primary after the mark is set.
However there's oversight here. "SET TRANSACTION READ ONLY" does no
data modification and should be treated as an exception.
Per bug #157.
- Fix FATAL error with reloading (Tatsuo Ishii)
While reloading pgpool.conf, the number of DB nodes is tentatively set
to 0, then counted up until reaching to the actual number of backends
by the pgpool main process. Unfortunately the variable was on the
shared memory and it confused pgpool child process when they were using
the variable and this caused FATAL error.
Per bug #156 report by harukat.
- doc: Add restriction about starting multiple pgpool simultaneously
(Yugo Nagata)
- Fix a in-memory query cache bug (Tatsuo Ishii)
If extended query protocol is used and a bind/execute message arrives
which uses a statement created by prior parse message, the temp_cache
is not initialized by a parse messages. Thus messages are added to pre
existing temp cache buffer which causes the trouble, that is, when the
cached result returns, Data Row message and Command Complete message
appeared twice.
Per by bug #152.
- Ignore close statement/portal request if they do not exist (Tatsuo Ishii)
In this case just returns a close complete message to client.
This is a back port of the following commit from pgpool-II 3.4:
1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0
===============================================================================
3.2.12 (namameboshi) 2015/07/24
* Version 3.2.12
This is a bugfix release against pgpool-II 3.2.11.
__________________________________________________________________
* Bug fixes
- Fix "cannot find xlog functions" error in pgpool-recovery
(Muhammad Usama)
The argument data type of PostgreSQL's pg_xlogfile_name() function
has been changed from text to pg_lsn since PostgreSQL 9.4. And
pgpool-recovery was still trying to locate the function by old
signature.
- Pass empty string parameters in failover command when pgpool-II
does not have a value for any particular parameter (Muhammad Usama)
Instead of omitting the values for the parameters when pgpool-II does
not have any value for a particular parameter, it now passes an empty
string to the failover command. This makes sure that failover script
will always receive the exact number of expected parameters.
- doc: Fix outdated limitation description about load balancing using
JDBC driver (Tatsuo Ishii)
Even if autocommit is false, load balancing is possible in certain
conditions.
- Allow to use in-memory query cache size more than 4GB (Tatsuo Ishii)
This should have been allowed since in memory query cache was born.
- Do not send a query for checking insert lock in non replication mode
with extended query (Tatsuo Ishii)
===============================================================================
3.2.11 (namameboshi) 2015/04/08
* Version 3.2.11
This is a bugfix release against pgpool-II 3.2.10.
__________________________________________________________________
* Bug fixes
- Fix to use void * type for receiving return value of thread function
(Yugo Nagata)
Previously int type was used and this could occur stack buffer
overflow. This caused an infinity loop of ping error at bringing
up or down VIP.
- Fix to set SIGCHLD to SIG_DFL instead of SIG_IGN in watchdog processes
(Yugo Nagata)
When using waitpid, it isn't necessary to set SIGCHLD to SIG_IGN.
Rather, it is harmful, and due to this it was regarded that ping
command exited abnormally in error even when this succeeded.
- Remove an unnecessary include directive (Yugo Nagata)
- Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii)
This is used in show pool_status command and limits the length of
parameter description. Unfortunately recovery_timeout description is
64 chars, which is 1 byte longer than former definition of the macro.
- Support SSL certificate chains in the certificate file for incoming
frontend connections (Muhammad Usama)
- Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama)
When graceful node detach is requested gracefully, pcp_detach_node should
check if it is allowed to process detach_node command on the particular
node before blocking the incoming connections and closing the existing
connections.
===============================================================================
3.2.10 (namameboshi) 2015/02/05
* Version 3.2.10
This is a bugfix release against pgpool-II 3.2.9.
__________________________________________________________________
* Bug fixes
- doc: Describe explicitly that the number of slave nodes is not
necessarily 1 (Tatsuo Ishii)
- Fix uninitialized variable (Tatsuo Ishii)
Per Coverity 1234603.
- doc: Fix missing release note entries in the previous release
(Tatsuo Ishii)
- Fix possible segmentation fault in query cache (Tatsuo Ishii)
- Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii)
The node id should be lower than NUM_BACKENDS. Probably harmless since
callers never pass node ids greater or equal to NUM_BACKENDS.
- Allow $_IP_$ having address prefix in if_up_cmd and if_down_cmd
(Muhammad Usama)
Previously, it is assumed that "$_IP_$" keyword will always have a
white space at the end, and when "$_IP_$" has address prefix (e.g.
$_IP_$/24), this prefix was ignored.
Per bug #122.
http://www.pgpool.net/mantisbt/view.php?id=122
- Allow "show pool_nodes" to print node ids having more than one digits
(Muhammad Usama)
Problem reported in [pgpool-general: 3374].
- Fix to disable debug mode by reloading config (Yugo Nagata)
Per bug #114
http://www.pgpool.net/mantisbt/view.php?id=114
===============================================================================
3.2.9 (namameboshi) 2014/09/05
* Version 3.2.9
This is a bugfix release against pgpool-II 3.2.8.
__________________________________________________________________
* Bug fixes
- Fix a typo of pgpool.spec (Yugo Nagata)
- Fix bug that worker child process keeps failing when there's no
primary backend (Tatsuo Ishii)
Problem identified and fix contributed by Junegunn Choi.
See [pgpool-hackers: 471] for more details.
- Close listen socket when smart shutdown request is made (Tatsuo Ishii)
When smart shutdown process starts, pgpool children still listen on
the port and clients can send further connection requests which fail
in the end. Which is not only waste of time, but also prevents a load
balancer which sits in front of pgpool from realizing the pgpool is
going down.
Problem analyzed and patch provided by Junegunn Choi in [pgpool-hackers
474], and enhanced to take care not only inet domain socket but UNIX
domain socket by Tatsuo Ishii.
- doc: Add cautions that recovery commands are killed by statement_timeout
of PostgreSQL. (Tatsuo Ishii)
- doc: Remove old restriction description which is no longer true
(Tatsuo Ishii)
- Fix return type of text_to_lsn() function (Yugo Nagata)
This caused compile warning.
- Fix file descriptor leak when daemonize. (Tatsuo Ishii)
Per Coverity 1111471.
- Fix memory leak. (Tatsuo Ishii)
Per Coverity 1111442.
- Fix pgpool.init's long-standing bug of stop/restart failure
(Yugo Nagata)
In previous, pgpool.init uses killproc for stopping pgpool, but there
are several problems. In the new version, "pgpool -m fast stop" is
used in stop command.
Original patch contributed by Ryan DeShone and modified by Yugo Nagata.
See [pgpool-hackers: 239][pgpool-hackers: 512].
- Add missing include file sys/wait.h. (Tatsuo Ishii)
Per bug #104.
http://www.pgpool.net/mantisbt/view.php?id=104
- Disable statement_timeout of PostgreSQL while executing online recovery
(Tatsuo Ishii)
Online recovery may take very long time and user may enable statement
timeout. To prevent online recovery canceled by statement timeout,
disable statement timeout in the connection used by online recovery.
See [pgpool-general: 2919] for more details.
- Remove unnecessary call to pool_shmem_exit() which removes semaphore
when it shouldn't (Tatsuo Ishii)
exit_handler checks if the process is parent or not. This is
good. However, even if it is a child process, it calls
pool_shmem_exit() which removes semaphore and shmem when it should
not. It should be called only from parent process.
Per bug #102.
http://www.pgpool.net/mantisbt/view.php?id=102
- Fix reset query stuck problem. (Tatsuo Ishii)
It is reported that reset query (DISCARD ALL etc.) occasionally does
not finish and pgpool child remain waiting for reply from backend thus
client cannot connect to pgpool.
The cause of problem is not identified yet but if client suddenly
closes connection to pgpool in the middle of query processing, backend
may not accept the reset queries because they are not ready for query.
The fix is, if frontend closes connection in unexpected way, query
process loop immediately returns with new state:
POOL_END_WITH_FRONTEND_ERROR and pgpool closes connection to
PostgreSQL then goes back to new connection request waiting loop.
Also, pgpool closes connections to backend when client_idle_limit is
set and the idle limit.
Per bug #107.
http://www.pgpool.net/mantisbt/view.php?id=107
===============================================================================
3.2.8 (namameboshi) 2014/03/24
* Version 3.2.8
This is a bugfix release against pgpool-II 3.2.7.
__________________________________________________________________
* Bug fixes
- doc: Add mention about "listen queue" and how to increase the "backlog"
in the num_init_children section. (Tatsuo Ishii)
- Fix bug that watchdog status goes down even when only one of trusted
servers get unpingable (Yugo Nagata)
- Fix bad performance of unlogged tables detection code. (Tatsuo Ishii)
Pointed out at [pgpool-hackers: 435][[pgpool-general:2325].
- Fix primary node detection logic. (Tatsuo Ishii)
There's a possibility that primary node is not detected. This happens
in following situation. node 0: primary, node 1: standby. Node 0 goes
down. Health checking detects the fact but local status is not updated
yet. Primary node finding (find_primary_node) runs. Node 0's status is
yet healthy. Because find_primary_node fails to connect to node 0, it
immediately returns -1 and fails to find that fact that node 1 is now
primary.
Fix is just continuing to look for primary node when fails to connect
to a node.
Per [pgpool-general: 2409].
- Fix jdbc DML fails when operated in raw mode and auto commit is off.
(Tatsuo Ishii)
This is reported in bug #92.
- Fix query cache bug with extended protocol. (Tatsuo Ishii)
SELECT retrieves outdated cache even DML was executed in an explicit
transaction. The bug had been there since in memory query cache was
born. Per [pgpool-general-jp: 1252].
- Add missing entries "relcache_size" and "check_temp_table" to show
pool_status (Tatsuo Ishii)
- Avoid to send queries to unrelated nodes in streaming replication mode.
(Tatsuo Ishii)
Pgpool-II sends certain queries, such as BEGIN, END and SET commands to
all of DB nodes. However in streaming replication mode, only primary
node and at most one standby node are only concerned (if primacy node
is selected as the load balance node, only 1 node is concerned).
See [pgpool-hackers: 464] for more details.
- Fix possible buffer overrun problem and memory leak. (Tatsuo Ishii)
Per Coverity 1111465 and 1111482.
- Fix possible buffer overrun. (Tatsuo Ishii)
Replace strcpy() with strlcpy(). Per Coverity report 1111478, 1111480,
1111481.
- Fix freeing NULL. (Tatsuo Ishii)
Per Coverity 1111384.
- Do not enable query cache on materialized views. (Tatsuo Ishii)
Per bug #95.
- Fix memory leak. (Tatsuo Ishii)
Per Coverity 1111446.
- Fix a segmentation fault in parallel mode with system_db_hostname is
empty (Yugo Nagata)
- Fix to output debug messages in processing pgpool.conf with -d option
(Yugo Nagata)
Previously, some debug messages in pool_get_config() ware not output
even when -d option was used.
- Fix JDBC exception of prepared statement including now() in
replication mode (Yugo Nagata)
With JDBC, when a prepared statement is executed more than
PrepareThreshold times, the statement is named and Describe message
is sent after Parse. With named statement, pgpool rewrite now() to
parameter in replication mode. Hence, rewritten query has additional
parameter than original. In this case, ParameterDescription message
sent to frontend (response of Describe) should include OIDs of the
same number os original query's parameters. Otherwize, JDBC throws
ArrayIndexoutOfBoundsException.
This is reported in [pgpool-general-jp: 1192].
- Fix backend error of prepared statement about table which has column whose
default value is now() in replication mode (Yugo Nagata)
When pgpool parses a named prepared statement with default now(),
timestamps are replaced to additional parameters. So, Bind message also
should included additional parameter format codes. However, when the
number of original parameter was one, pgpool didn't handle this. This
caused a error like "incorrect binary data format in bind parameter 2".
- doc: Add description about parallel mode doesn't support PREPARE (Yugo Nagata)
Per bug #93
===============================================================================
3.2.7 (tokakiboshi) 2013/12/06
* Version 3.2.7
This is a bugfix release against pgpool-II 3.2.6.
__________________________________________________________________
* Bug fixes
- Fix incorrect time stamp rewriting in replication mode for certain time
zones. (Tatsuo Ishii)
Time stamp rewriting calls "SELECT now()" to get current time.
Unfortunately the buffer for the current time is too small for certain
time zones such as "02:30". Note that non-30-minutes-time-zone such as
"0900" does not reveal the problem. This explains why we haven't the bug
report until today.
Bug reported in [pgpool-general: 2113] and fix provided by Sean Hogan.
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002142.html
- Makefile: Replace pg_config by $(PG_CONFIG) in Makefiles so it can be
overridden at build time when compiling for different PG major versions.
(Tatsuo Ishii)
Patch contributed by Christoph Berg ([pgpool-general: 2127]).
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html
- Remove -lcompat because it confuses FreeBSD per bug#15. (Tatsuo Ishii
http://www.pgpool.net/mantisbt/view.php?id=15
- Fix segfault when pgpool.conf does not set log_standby_delay.
(Tatsuo Ishii)
This is caused by wrong initialization for log_standby_delay in
pool_config.l.
Per bug#74. http://www.pgpool.net/mantisbt/view.php?id=74
- doc: Modify descriptions about restrictions of parallel mode
Multiple rows INSERT using VALUES are not supported in parallel mode.
(Yugo Nagata)
- Avoid calling find_primary_node_repeatedly() when standby node goes
down. (Tatsuo Ishii)
This will reduce the time to failover. Per bug #75, patch modified by
Tatsuo Ishii. http://www.pgpool.net/mantisbt/view.php?id=75
- Fix data inconsistency problem with native replication mode + extended
protocol case. (Tatsuo Ishii)
It is reported that concurrent INSERT using JDBC driver causes data
difference among database node. This only happens following conditions
are all met:
1) Native replication mode
2) Extended protocol used
3) The portal created by parse message is reused by bind message
4) autocommit is on
5) SERIAL (sequence) is used
Pgpool-II's parse message function knows it has to lock the target
table when INSERT (plus #5) is issued by clients. Unfortunately bind
message function did not know it. Once parse/bind/execute finishes,
pgpool releases the lock obtained by parse because of #4. JDBC wants
to reuse the portal and starts the cycle from bind message, which does
not obtain lock. As as result, lock-free INSERT are floating around
which causes data inconsistency of course. The solution is, lock the
table in bind phase.
For this bind needs to issue LOCK in extended protocol. This was a little
bit hard because the module (do_command()) to issue internal SQL command
(other than SELECT) does not support extended protocol.
To solve the problem do_query() is modified so that it accepts other than
SELECT because it already accepts extended protocol.
The modification is minimum and is only tested for the case called from
insert_lock(). I do not recommend to replace every occurrence of
do_command () with do_query() at this point.
BTW the reason why the bug is not reported is, most users uses JDBC
with auto commit = off. In this case, the lock obtained by parse persists
until user explicitly issues commit or rollback.
Per bug report by Steve Kuekes in [pgpool-general: 2142].
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002171.html
- Fix memory allocation size bug in the code path of query cache.
(Tatsuo Ishii)
In execute() memory allocation size is too small incertain case. No bug
has been reported so far, but certainly this is a bug.
- Fix occasional segfault in query cache + extended protocol.
(Tatsuo Ishii)
When the query is not "cache safe", bind_msg->param_offset was not set
in Bind(). However, Execute() unconditionally uses bind_msg->param_offset
to convert bind parameters to string so that they can be added to the
cached query string and it causes segfault because bind_msg->param_offset
is a garbage. Also logic bug to calculate bind_msg->param_offset is
corrected.
Per bug#76. http://www.pgpool.net/mantisbt/view.php?id=76
- Avoid to run out free query cache hash index entry. (Tatsuo Ishii)
If hash index entries are run out, pgpool-II cannot reuse old cache
entry because pgpool-II always expects there's at least one empty hash
index entry. To mitigate the problem, if free hash index entries are run
out, look for victim cache block to reuse the hash index entry.
Per bug #70. http://www.pgpool.net/mantisbt/view.php?id=70
- Fix inappropriate shared memory allocation size for clock hand.
(Tatsuo Ishii)
The memory for clock hand was allocated as sizeof(pool_fsmm_clock_hand))
which is 8 bytes long because the variable is declared as:
static int *pool_fsmm_clock_hand;
This is plain wrong. The memory size actually needed is only 4 bytes,
which is sizeof(*pool_fsmm_clock_hand)). In other word, the bug allocated
unnecessary 4 bytes, which did nothing bd for the execution of program.
But a bug is a bug.
Per coverity report "1111476 Wrong sizeof argument"
- Fix "show pool_status" always shows memqcache_auto_cache_invalidation as
0. (Tatsuo Ishii)
Per bug #80. http://www.pgpool.net/mantisbt/view.php?id=80
- Fix error message in read_password_packet(). (Tatsuo Ishii)
- watchdog: Fix to pass big parameter by pointer instead of by value at
some function. (Yugo Nagata)
- Fix memory leak when SSL is requested. (Tatsuo Ishii)
When SSL is requested, pgpool child retries to read start up packet.
However it does not free the memory for previous start up packet.
Per Coverity report "1111443 Resource".
- Fix memory leak when do_query() fails in timestamp rewriting.
(Tatsuo Ishii)
For this purpose free_select_result() is changed to accept NULL argument.
Per Coverity report "1111454, 1111455 Resource leak".
- watchdog: Fix to put null character at end of ping result string used in
watchdog. (Yugo Nagata)
- Fix target node selection logic when "DEALLOCATE portal|statement".
(Tatsuo Ishii)
When "DEALLOCATE portal|statement" is used and last prepared statement or
portal was not found, target node selection map is not set. Probably this
is not actually harmful because prepared statement or portal was not found
is an error case. The bug was there since day 0.
Per Coverity report "1111491 Structurally dead code".
- Fix range check bug of MAX_NUM_BACKENDS in corner case. (Tatsuo Ishii)
MAX_NUM_BACKENDS is the allowed max number of DB nodes (128, at this
point). In reality, probably no one ever tried more than 128 DB nodes
and that's the reason why nobody noticed.
Per Coverity report "1111429, 1111430 and 1111431 Out-of-bounds write".
- Do not set/unset fronted connection info for dead backend. (Tatsuo Ishii)
Per bug #82. http://www.pgpool.net/mantisbt/view.php?id=82
- Fix that the script forgets to allow public access to pgpool_catalog.
(Tatsuo Ishii)
The bug prevents inserting data into user tables if pgpool_catalog is
created in native replication mode. The bug was there from day 1. I
wonder why nobody noticed until today.
Per [pgpool-general-jp: 1229].
http://www.sraoss.jp/pipermail/pgpool-general-jp/2013-November/001228.html
- Fix uninitialized variable in error case in pool_do_auth().
(Tatsuo Ishii)
If there's no valid backend, pgpool will return garbage pid to frontend in
auth phase. Actually because no backend is available, frontend will be
disconnected later on. So this is not harmless.
Per Coverity report "1127331 Uninitialized scalar variable".
- Fix to add node id range check when issue an error message using node
id. (Tatsuo Ishii)
Per Coverity report #1111433 "Out-of-bounds read".
- Fix buffer overrun bug and resource leak bug of parse_copy_data().
(Tatsuo Ishii)
Per Coverity report 1111427 "Out-of-bounds write" and 1111453 "Resource
leak".
- Fix possible segfault in CopyDataRaws(). (Tatsuo Ishii)
Coverity pointed out that if pool_get_id() returns an error, VALID_BACKEND
will access out of array.
Per Coverity report 1111413 "Memory - illegal accesses".
- Fix query cache is enabled and protocol version = 2 case. (Tatsuo Ishii)
When the protocol version = 2, we assume that session state is "idle".
This is not feasible but no way. I recommend to not use query cache
with protocol 2.
Per Coverity report 1111488 "Uninitialized scalar variable".
- Fix strftime() usage in pool_pools(). (Tatsuo Ishii)
The buffer is not large enough as expected by the second parameter. This
is not harmless because the format string will not produce longer result
string than the buffer.
Per Coverity report 1111426 "Out-of-bounds access".
- Fix resource leak in make_persistent_db_connection. (Tatsuo Ishii)
For this purpose, new static function free_persisten_db_connection_memory
is added.
Per Coverity report #1111468.
- Fix a bug that connection check to trusted servers fails when the RTT
is very short. (Yugo Nagata)
- Fix several small bug fixes detected by Coverity. (Tatsuo Ishii)
===============================================================================
3.2.6 (namameboshi) 2013/09/06
* Version 3.2.6
This is a bugfix release against pgpool-II 3.2.5.
__________________________________________________________________
* Bug fixes
- Fix a segmentation fault on main process that could occurs after backend
error detection (Tatsuo Ishii)
This is reported in Bug track #62 by tuomas.
#62 Slave network outage causes a segmentation fault on main process
http://www.pgpool.net/mantisbt/view.php?id=62
- Fix a bug with health check when used with child_life_time (Tatsuo Ishii)
Failover could happen even if the backend was running fine.
This problem is reported in [pgpool-general: 1892] by larisa sabban.
[pgpool-general: 1892] Pgpool is unable to connect backend PostgreSQL
http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001920.html
- Fix "Deploying pgpool-II" section in the document (Tatsuo Ishii)
Update descriptions about watchdog use.
- Fix a mistake in ssh command of doc/basebackup.sh (Tatsuo Ishii)
- Fix a bug in parsing prepared statements with transaction handling in
replication mode (Tatsuo Ishii)
Parse() automatically starts a transaction for non SELECT query to keep
consistency among nodes in replication mode. But this wasn't closed. If
wrong query comes in, the transaction goes into an abort state but pgpool
does not close the transaction. Thus next query causes error because the
transaction is still in abort status.
This problem was reported in [pgpool-general: 1877] by Sean Hogan.
[pgpool-general: 1877] current transaction is aborted, commands ignored
http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001905.html
- Fix child process termination with sig abort when memory query cache
is enabled (Tatsuo Ishii)
This is due to double free bug that occurs when multiple bind/execute
messages come after a parse message. When a parse messages comes, query
context is created along with temp cache. The pointer to the temp cache
is added to the temp cache array when the query executed. Subsequent
bind messages uses the same temp cache pointer. This is the source of
double free bug when the cache array discarded.
This is reported in Bug track #68 by harukat.
#68: child process termination with sigabort when memory_cache_enabled = on
http://www.pgpool.net/mantisbt/view.php?id=68
- Fix typos of the japanese document (Yugo Nagata)
===============================================================================
3.2.5 (namameboshi) 2013/07/10
* Version 3.2.5
This is a bugfix release against pgpool-II 3.2.4.
__________________________________________________________________
* Bug fixes
- Add mention about "-D" option to the man page. (Tatsuo Ishii)
- Consider timeout waiting for completion of failback request in on line
recovery (Tatsuo Ishii)
This will prevent the situation that recovery operation continues forever
and we cannot even shutdown pgpool-II main process. This could happen
especially while executing follow master command.
- Fix a bug that %H of follow_master_command is not assigned correctly the
new primary node in stream replication mode
(Tatsuo Ishii)
- Fix wd_create_send_socket() to not execute select() before connect()
(Yugo Nagata)
How select() works on an unconnected socket is undefined, and differs
between platform. On Linux, this returns 2 and it is eventually harmless.
However, on Soraris, this returns 0 and it is indistinguishable from time
timeout, so watchdog wouldn't work correctly.
- Fix error when pgpool_regclass is not installed (Tatsuo Ishii)
The query used in pool_has_pgpool_regclass() fails if pgpool_regclass
does not exist. The bug was introduced in 3.2.4. See [pgpool-general:
1722] for more details.
[pgpool-general: 1722] [PgPool-II 3.2.4] pgpool_regclass now mandatory?
http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001749.html
- Fix do_query() to not hang when PostgreSQL returns an error
(Tatsuo Ishii)
The typical symptom is "I see SELECT is keep on running according to
pg_stat_activity". To fix this pgpool-II just exits the process and
kill the existing connection. This is not gentle but at this point I
believe this is the best solution.
- Fix possible deadlock during failover with watchdog enabled
(Yugo Nagata)
This is reported in Bug track #54 by arshu arora
#54 pgpool-II semaphore lock problem
http://www.pgpool.net/mantisbt/view.php?id=54
- Fix bug with do_query which causes hung in extended protocol
(Tatsuo Ishii)
This problem could occur when insert lock is enabled and
pgpool_catalog.insert_lock exists, See [pgpool-general: 1684] for more
details.
[pgpool-general: 1684] insert_lock hangs
http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001711.html
- Fix unnecessary degeneration caused by error on commit (Tatsuo Ishii)
In master slave mode, if master gets an error at commit, while other
slaves are normal at commit, we don't need to degenerate any backend
because it is likely that the "kind mismatch error" was caused by a
deferred trigger.
- Fix possible failure of query cache invalidation for DML in transaction
(Tatsuo Ishii)
CREATE TABLE t1(i INTEGER);
CREATE TABLE t2(i INTEGER);
SELECT * FROM t1;
BEGIN;
DELETE FROM t2 WHERE i = 0;
INSERT INTO t1(i) VALUES(1);
COMMIT;
SELECT * FROM t1;
At commit pgpool tries to delete cache for t2 but fails because
there's no oid table entry for t2. Problem is, it fails to check oid
table for t1. So cache for t1 remains and the last SELECT incorrectly
returns cached data. Fix is, continuing to check oid table entries.
This is reported in Bug track #58 by wms
#58 query cache invalidation does not fire for multiple DML in transaction
http://www.pgpool.net/mantisbt/view.php?id=58
- Fix to register pgpool_regclass in pg_catalog schema (Tatsuo Ishii)
This is necessary to deal with clients which restricts schema search path
to pg_catalog only. Postgres_fdw is such a client.
- Fix a potential crash in pg_md5 command (Muhammad Usama)
- Fix a segmentation fault that occurs when on memory query cache enabled
and the query is issued in extended query mode and the result is too large
(Tatsuo Ishii)
This is reported in Bug track #63 by harukat.
Analysis and a test case are also provided.
#63 Child process was terminated by segmentation fault with memcached
http://www.pgpool.net/mantisbt/view.php?id=63
- Fix a segmentation fault of a child process that occurs when a startup
packet has no PostgreSQL user information (Yugo Nagata)
You can reproduce it by
$ psql -p 9999 -U ''
If enable_pool_hba is on, a child process terminates by segmentation
fault. Otherwise if enable_pool_hba is off, the error message is
ERROR: pool_discard_cp: cannot get connection pool for user (null)
database (null)
In both cases, psql terminates with no message on frontend.
In the fixed version, if PostgreSQL user is not specified in startup packet,
the message as following is output to both log and frontend. This is
the same behavior as PostgreSQL.
FATAL: no PostgreSQL user name specified in startup packet
- Fix memory allocation logic in extended query processing with on-memory
query cache enabled (Tatsuo Ishii)
When very long query string (> 1024 bytes) supplied in extended query
with bind parameters, it fails to allocate enough memory.
- Move ssl_ca_cert and ssl_ca_cert_dir descriptions to the SSL section
(Yugo Nagata)
- Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document
(Yugo Nagata)
- Fix to verify the backend node number in pcp_recovery_node (Yugo Nagata)
When an invalid number is used, null value is passed as an arguments
of recovery script, and this causes a malfunction. In especially,
rsync may delete unrelated files in basebackup scripts.
===============================================================================
3.2.4 (namameboshi) 2013/04/26
* Version 3.2.4
This is a bugfix release against pgpool-II 3.2.3.
__________________________________________________________________
* Bug fixes
- Fix connect_inet_domain_socket_by_port() to set more appropriate value
for timeout parameter of select(2). (Tatsuo Ishii)
Some platforms such as Solaris do not allow to specify too large
microseconds timeout value (>=1000000). So divide the timeout value to
seconds and microseconds.
- Fix connect_inet_domain_socket_by_port() to not return as normal when
interrupted by alarm. (Tatsuo Ishii)
This confuses health checking because connect_inet_domain_socket_by_port()
returns usable fd. This makes detecting errors in health checking longer.
See the following for more details:
[pgpool-general: 1458]
health check timeout in pgpool-II-3.2.3
http://www.pgpool.net/pipermail/pgpool-general/2013-March/001482.html
- Fix long standing bug with timestamp rewriting code for processing
extended protocol. (Tatsuo Ishii)
Parse() allocate memory using palloc() while rewriting the parse
message. Problem is, the rewritten message was kept in the data which
is managed by pool_create_sent_message() etc. The function assumes
that all the data is in session context memory. However, palloc()
allocates memory in query context of course, and gets freed later on
when the query context disappears. And the function tries to free the
memory as well, which causes various problems, including segfault and
double free. To fix this, memory to store rewritten message is
allocated using session context. The bug was there since pgpool-II 3.0
was born.
Problem analysis and patch contributed by Naoya Anzai.
[pgpoolgenera-jp: 1146]. (in Japanese)
http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001145.html
- Fix bug with md5 auth long user name handling. (Tatsuo Ishii)
If user name is longer than 32 bytes, md5 authentication doesn't work.
Problem reported in [pgpool-general: 1526] by Thomas Martin.
[pgpool-general: 1526]
[pgPool-II 3.2.3] MD5 authentication and username longer than 32 characters.
http://www.pgpool.net/pipermail/pgpool-general/2013-March/001551.html
- Fix to calculate replication delay only if standby server is behind from
the primary server. (Yugo Nagata)
When the primary server is behind from standby server, negative value of
delay is calculated and the value is assigned to unsigned variable. It
causes a log message informing negative replication delay. And what is
worse, it also causes SELECT queries to be sent to the primary in load
balance even though there are no replication delay in fact.
The problem is reported and analyzed by Saitoh Hidenori in
[pgpool-genera-jp: 1145].
[pgpool-general-jp: 1145] (in Japanese)
http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001144.html
- pgpool-recovery adopts PostgreSQL 9.3. (Tatsuo Ishii)
Patch contributed by Asif Rehman. Slight editing by Tatsuo Ishii.
[pgpool-hackers: 180]
compile error in ppool-recovery
http://www.pgpool.net/pipermail/pgpool-hackers/2013-April/000179.html
- Fix pool_has_pgpool_regclass() to check execute privilege of
pgpool_regclass(). (Tatsuo Ishii)
Even though pgpool_regclass() exists, if pgpool cannot execute the
function, the connection to backend hangs. You can reproduce the problem
by just dropping the execute privilege from pgpool_regclass and do some
insert in native replication mode.
The problem is reported in bugtrack #53.
#53 pgpool_regclass hangs all connections
Date: 2013-04-04 13:35
Reporter: tmandke
http://www.pgpool.net/mantisbt/view.php?id=53
- Fix error message mistakes in detect_postmaster_down_error(). (Tatsuo Ishii)
For example, "LOG: detect_stop_postmaster_error: detect_error error" is
fixed to "LOG: detect_postmaster_down_error: detect_error error", and so on.
- Remove root user check when watchdog is enabled. (Tatsuo Ishii)
Per discussion [pgpool-general: 1627] Re: watchdog root requirement.
[pgpool-general: 1627]
Re: watchdog root requirement.
http://www.pgpool.net/pipermail/pgpool-general/2013-April/001654.html
- Fix bug with on memory query cache in handling UPDATE/DELETE with table
alias. (Tatsuo Ishii)
If UPDATE/DELETE is with table alias (UPDATE t1 AS foo...) pgpool thinks
the table name is "t1 AS foo" and fails to invalidate query cache. This
is caused by _outRangeVar() called from nodeToString() which generates a
query string from RangeVar node in raw parse tree. The solution is removing
"AS foo" part from the output of the string.
Reported in bugtrack #56.
#56 UPDATE with alias does not discard cache
Date: 2013-04-18 17:33
Reporter: harukat
http://www.pgpool.net/mantisbt/view.php?id=56
===============================================================================
3.2.3 (namameboshi) 2013/02/18
* Version 3.2.3
This is a bug fix release against pgpool-II 3.2.2. Main purpose
of this release is to fix fatal problem with pgpool-II 3.2.2's
health checking. If all of following conditions are met, pgpool
main process disappeared and all client connections to pgpool-II
hang forever when failover happens. And the only way to recover
from it is, manually killing the pgpool child process and restart
pgpool-II.
- health checking is enabled
- connecting method to PostgreSQL is TCP/IP, not UNIX domain
socket(i.e. "backend_hostnameN" is not empty string)
__________________________________________________________________
* Bug fixes
- Fix connect_inet_domain_socket_by_port() bug introduced in
3.2.2. (Tatsuo Ishii)
When non blocking connect() reports EINPROGRESS or EALREADY, it
calls select(2) to wait for read or write fd ready. However it
mistakenly checks error condition using getsockopt(). It should
be called when select() returns > 0, rather than 0. Because of
this, connect_inet_domain_socket_by_port() could return
succeeded fd even it actually failed.
And what is worse, this health_check() mistakenly believes that
backend is alive and tries to write to backend socket, which of
course fails. This triggers to call notice_backend_error(),
which sends SIGUSR1 signal to pgpool main's parent process. This
will result in various weird things: for example, if you start
pgpool from a shell, the signal kills the shell. If you start
pgpool in background, pgpool's parent is the process #1. As long
as you started pgpool as non root, it's ok. Even if you start
pgpool as root, init just reopens /dev/initctl by receiving
SIGUSR1. These all annoying bugs have been there since pgpool
was born. The connect_inet_domain_socket_by_port() bug just
reveals it. To fix this, I modified notice_backend_error and
child_exit() so that it does nothing when called from pgpool
main process itself to prevent pgpool from shooting itself in
the foot.
- Fix to show pool_passwd in "SHOW pool_status". (Yugo Nagata)
- Fix a typo at configure's help in configure.in. (Yugo Nagata)
===============================================================================
3.2.2 (namameboshi) 2013/02/08
* Version 3.2.2
This is a bugfix release against pgpool-II 3.2.1.
__________________________________________________________________
* Bug fixes
- Fix compile errors on FreeBSD. (Tatsuo Ishii)
- Fix pgpool does not recognize VIEWs other than in default schema,
which is usually "public". (Tatsuo Ishii)
This makes pgpool to create caches for such a VIEW's query results,
which of course should not be allowed.
Problem reported and patch provided by jgentsch in bug id #30.
#30 pgpool 3.2.1 - views in schema other than public are caching
Reporter: jgentsch
Date: 2012-10-19 23:13
http://www.pgpool.net/mantisbt/view.php?id=30
- Fix race condition when using md5 authentication. (Tatsuo Ishii)
The file descriptor to pool_passwd is opened in pgpool main and pgpool
child inherits it. When concurrent connections try to authenticate md5
method, they call pool_get_passwd and seek the fd and cause random md5
auth failure because underlying fd is shared. Fix is, let individual
pgpool child open the file by calling pool_reopen_passwd_file.
Problem reported and analyzed by Jason Slagle in pgpool-general:1141.
[pgpool-general: 1141] Possible race condition in pool_get_passwd
From: Jason Slagle
Date: Sun, 28 Oct 2012 01:12:52 -0400
http://www.sraoss.jp/pipermail/pgpool-general/2012-October/001160.html
- Clarify load balance condition information in manual. (Tatsuo Ishii)
- Fix segfault due to bug with query cache array handling. (Tatsuo Ishii)
The cache array is used to keep temporary cache results in a transaction.
If there are more than 128 SELECTs in a transaction, the module expands
cache_array by using realloc. However it does not record the new pointer
returned by realloc. So the module keeps on using the old pointer which is
obsoleted.
This problem is reported in bug track #31 by jgentsch.
#31 pgpool V3_2_STABLE - segfault in pool_memqcache.c:2529
Reporter:jgentsch
Date: 2012-10-23 06:25
http://www.pgpool.net/mantisbt/view.php?id=31
- Fix hung up while repeating pcp_attach_node and pcp_detach_node
(Tatsuo Ishii)
When node status is changed by pcp_attach_node and pcp_detach_node,
failover() sends SIGUSR1 to pcp_child process expecting it exits to
refresh node status. In this situation lots of pgpool children exit and
produce SIGCHLD as well. The SIGCHLD handler reaper() tries catch all
SIGCHLD but sometimes it fails depending on the system load and timing.
If SIGCHLD produced by pcp child is not caught, the process becomes
zombie and never restarted.
This problem is reported in bug track #32 (by oleg_myrk) etc.
#32 PGPool hangs on pcp_attach/detach
Reporter: oleg_myrk
Date: 2012-10-24 00:01
http://www.pgpool.net/mantisbt/view.php?id=32
- Fix pool_send_severity_message() not to use uninitialized memory.
(Tatsuo Ishii)
It cause a segmentation fault.
Reported in Bug #33's attached valgrind output by dudee.
#33 pgpool-II 3.2.1 segfault
Reporter: dudee
Date: 2012-10-30 19:16
http://www.pgpool.net/mantisbt/view.php?id=33
- Fix bug with query cache returning incorrect data in some cases when a
persistent table and temp table have same name. (Tatsuo Ishii)
Here is a sequence to trigger the bug:
1) CREATE TABLE t1(i int); -- create a persistent table
2) INSERT INTO t1 VALUES(1);
3) SELECT * FROM t1; -- query cache entry created
4) CREATE TEMP TABLE t1(i int); -- create a temp table
5) SELECT * FROM t1; -- query cache entry mistakenly created!
Problem is #3 creates relcache entry for t1, and #5 incorrectly uses it
and believes that temp table t1 is not a temp table.
- Add a description about "-f" to help message. (Tatsuo Ishii)
- Fix reaper() not to exit wait3() loop when catches pcp or worker child
exit event. (Tatsuo Ishii)
Otherwise reaper() mistakenly ignore some process exit event and make a
risk of creating zombie process and forgetting to create new process.
Problem reported and fix suggested by Goto in [pgpool-general-jp: 1123].
http://www.sraoss.jp/pipermail/pgpool-general-jp/2012-November/001122.html
(in Japanese)
- Fix a typo of configure help message. (Yugo Nagata)
- Add wd_hostname to pool_process_reporting.c. (Yugo Nagata)
Otherwise, wd_hostname is not contained in results of SHOW pool_status and
cp_pool_status.
- Fix connect_inet_domain_socket_by_port() to not error out when connect(2)
returns EISCONN (Socket is already connected) error. (Tatsuo Ishii)
This could happen with non blocking socket and should be treated as normal.
Per bug track #29 (by spork) and pgpool-general 1218 (by Mikola Rose).
#29 pgpool 3.2.1 cannot connect to db hosts
Reporter: spork
Date: 2012-10-18 15:03
http://www.pgpool.net/mantisbt/view.php?id=29
[pgpool-general: 1218] pgpool 3.2.1 - Health check failing to connect
From: Mikola Rose
Date: Tue, 4 Dec 2012 20:21:55 +0000
http://www.sraoss.jp/pipermail/pgpool-general/2012-December/001237.html
- Fix health_check() to check the health check timer before retrying
with template1 database. (Tatsuo Ishii)
Without this, the retry with node 0 always fails because health check timer
may be already expired.
- Fix pool_search_relcache() to use MASTER or MASTER_NODE_ID macro, rather
than REAL_MASTER_NODE_ID. (Tatsuo Ishii)
In case node 0 fail back in streaming replication mode, pgpool does not
restart child process. So REAL_MASTER_NODE_ID looks for node 0 con info,
which is not present until new connection to backend made. Thus referring
to node con info results in segfault. MASTER or MASTER_NODE_ID are safe in
this situation because they look at cached former master node id.
- Fix long standing bug "portal not found" error when replication delay
is too much in streaming replication mode. (Tatsuo Ishii)
The bug had been there since the delay threshold was introduced.
We changed destination DB node if delay threshold exceeds in bind,
describe and execute. However, if parse sends to different node, bind,
describe or execute will fail because no parsed statement or portal
exists. Solution is, not to send to different parse node even
if delay threshold is too much.
- Fix pg_md5 to output "\n" after user inputs password. (Yugo Nagata)
- Fix to print error message when the port number for watchdog is already used.
(Yugo Nagata)
This issue was reported by Will Ferguson in [pgpool-general: 1167].
[pgpool-general: 1167] Re: Watchdog error - wd_init: delegate_IP already exists
From: Will Ferguson
Date: Tue, 6 Nov 2012 13:03:36 +0000
http://www.sraoss.jp/pipermail/pgpool-general/2012-November/001186.html
- Fix child_exit() to not call send_frontend_exits() if there's no
connection pool. (Tatsuo Ishii)
Otherwise, it segfaults because send_frontend_exits() refers to objects
pointed to by pool_connection_pool. Per bug track #44 by tuomas.
#44 pgpool went haywire after slave shutdown triggering master failover
Reporter: tuomas
Date: 2012-12-11 00:33
http://www.pgpool.net/mantisbt/view.php?id=44
- Fix bug that only tables in white_memqcache_table_list was cached when
black_memqcache_table_list has any tables. (Yugo Nagata)
- Fix read_startup_packet() to reset alarm and free StartupPacket when
pool_read() returns 0 which means incorrect packet length. (Nozomi Anzai)
Previously, authentication timeout occurs when connected by a program
monitoring the pgpool port.It is reported in bug track #35.
#35 Authentication is timeout
Reporter: tuomas
Date: 2012-11-20 11:54
http://www.pgpool.net/mantisbt/view.php?id=35
- Fix long standing bug with pool_open(). (Tatsuo Ishii)
It initializes wrong buffer pointer. Actually this is harmless because the
pointer is initialized by prior memset() call, though.
- Log that failover is avoided because "fail_over_on_backend_error" is
turned off. (Tatsuo Ishii)
- Fix LISTEN/NOTIFY handling bugs. (Tatsuo Ishii)
1) In streaming replication mode:
Session 1: LISTEN aaa;
Session 2: NOTIFY aaa;
Session 1: LISTEN aaa; --- hangs
(If LISTEN and NOTIFY are issued in a same session, it works fine.)
We assume that packets come from all nodes. However in streaming
replication mode, notification message only comes from primary
node and we should avoid reading from standby nodes.
2) In streaming replication mode: If primary node is not node 0, it
hangs like #1 even if fix applies. This is because MASTER_NODE_ID
macro (actually pool_virtual_master_db_node_id()) always returns
REAL_MASTER_NODE_ID, which is node 0 (if it is alive). The function
should return PRIMARY_NODE_ID in master/slave mode.
3) In replication mode, LISTEN/NOTIFY simply does not work. In the
mode, NOTIFY is sent to all backends. However the order of arrival of
'Notification response' is not necessarily the master first and then
slaves. So if it arrives slave first, we should try to read from
master, rather than just discard it. Fixed in pool_process_query().
4) In replication mode, if LISTEN and NOTIFY are issued in a same
session, the session is disconnected because do_command() may receive
other than 'N', 'E', 'S' and 'C'. The solution is, put 'A' packet on a
stack and pop out when it is convenient. For this purpose, new
functions pool_push(), pool_pop() and pool_stacklen() are added.
This problem is reported in but grack #45 by rpashin.
#45 LISTEN/NOTIFY doesn't work if cluster contains more then 1 node in
streaming replication mode
Reporter: rpashin
Date: 2012-12-12 00:09
http://www.pgpool.net/mantisbt/view.php?id=45
Considering the size of the patch, I do not back patch to 3.1 or
before(so far, we have not heard any complaints on 3.1 or before).
- Fix connect_inet_domain_socket_by_port() to call select(2) rather than
error out when connect(2) returns EINPROGESS or EALREADY error.
(Tatsuo Ishii)
When using non-blocking socket, despite the errors like
"Connection timed out", actually connection has been established.
To solve the problem we should use select(2) to wait for connection
establishing when connect(2) reports EINPROGRESS or EALREADY, instead
of doing a retry tight loop.
This problem is reported in bug track #46 by mcousin.
#46 Watchdog failing to connect sometimes
Reporter: mcousin
Date: 2012-12-15 01:01
http://www.pgpool.net/mantisbt/view.php?id=46
- Add caution to increase num_init_children if watchdog enabled in manual.
(Tatsuo Ishii)
See [pgpool-general: 1330] for more details.
[pgpool-general: 1330] WatchDog and pgpool sudden stop working
From: Tomas Halgas
Date: Fri, 18 Jan 2013 14:47:23 +0100
http://www.sraoss.jp/pipermail/pgpool-general/2013-January/001350.html
- Fix segmentation fault while pgpool-II stating up or fail over when
watchdog is enabled. (Yugo Nagata)
This is caused by wrong usage of pthread, namely pthread_detach and
pthread_join are mixed together. Solution is to use pthread_join only
if we need to get status of child thread. BTW, the problem could occu
on moderately modern OS such as Fedora 17, but the reason why the problem
is not observed on other OSs is, just we were lucky.
Problem reported in [pgpool-general: 1179] by Lonni J Friedman.
[pgpool-general: 1179] 3.2.1 segfaults at startup on Fedora17.
From: Lonni J Friedman
Date: Mon, 12 Nov 2012 15:58:29 -0800
http://www.sraoss.jp/pipermail/pgpool-general/2012-November/001198.html
Patch provided by chads in bug track #48.
pthread_detach is being used wrong; causes pgpool to segfault.
Reporter: chads
Date: 2013-01-16 05:44
http://www.pgpool.net/mantisbt/view.php?id=48
- Avoid split-brain situation reported in [pgpool-general: 1046] (Yugo Nagata)
After all backend nodes are detached from pgpools and then some backend node
are attached to these, multiple active pgpools could exist simultaneously,
that is to say, split-brain situation occurs.
In this fix, when once all backend DB nodes are detached from pgpool, the pgpool
stays DOWN status until this is restarted. The pgpool in DOWN status cannot
escalate to active (delegate IP holder), so split-brain situation is avoided.
[pgpool-general: 1046]
watchdog enabled delegate_IP on multiple nodes simultaneously
From: Lonni J Friedman
Date: Wed, 26 Sep 2012 09:05:09 -0700
http://www.sraoss.jp/pipermail/pgpool-general/2012-September/001064.html
- Avoid a possible hang during the active pgpool exits. (Yugo Nagata)
When exiting, the active pgpool brings down the virtual IP and then
sends a packet to other pgpools. However, the packet sometimes is sent
before the virtual IP is brought down completely. In this case the packet
sender is set to this IP. When the IP is brought down before other pgpools
respond, the active pgpool can not receive the response, and hang up.
In this fix, the active pgpool confirms that the virtual IP is brought
down before sending the packet.
- Modify descriptions of restrictions on watchdog. (Yugo Nagata)
- Modify pgpool.conf.sample* and documents to correct information of
whether a certain parameter change requires restart. (Yugo Nagata)
- Add pool_passwd option to pgpool.conf.sample*, pool_process_reporting.c,
and documents. (Yugo Nagata)
Otherwise, wd_hostname is not contained in results of SHOW pool_status and
pcp_pool_status.
===============================================================================
3.2.1 (namameboshi) 2012/10/12
* Version 3.2.1
This is a bugfix release against pgpool-II 3.2.0.
__________________________________________________________________
* Bug fixes
- Fix send_cached_messages(). (Tatsuo Ishii)
Before it had 8192 bytes fix length buffer for each row data and if data
exceeded 8192 bytes, it just crashed.
To fix this, eliminate copying raw data which is passed as an argument
to buffer and pass the pointer to send_message.
- Fix that extended queries failed due to query cache. (Nozomi Anzai)
- Fix read_startup_packet(). (Tatsuo Ishii)
If packet length is lower than 0, it should have returned immediately.
Otherwise it would cause memory allocation error later on.
per pgpool-general:886. Also add canceling alarm.
[pgpool-general: 886] read_startup_packet: out of memory
From: Lonni J Friedman
Date: Wed, 8 Aug 2012 10:18:15 -0700
http://www.sraoss.jp/pipermail/pgpool-general/2012-August/000896.html
- Fix too watchdog process's aggressively kill other processes when pgpool
shuts down. (Tatsuo Ishii)
watchdog process calls kill(0,SIG) to kill all processes related to
watchdog. Unfortunately this will kill not only watchdog related
processes but parent pgpool and even httpd in case when pgpool was
invoked from pgpoolAdmin because they are in the same process
group.
So for now, fix is removing call to the kill() and setpgid() because
setpgid() does nothing useful.
In the future, we should call setsid() to establish new process group
in any case.
- Fix query cache to regist such queries that start with "-- comment" or
have comments more than one. (Nozomi Anzai)
- Fix query cache to ignore multi statement. (Nozomi Anzai)
In previous, queries like "SELECT 1;UPDATE..." were cached, too, but it
was wrong.
- Add a watchdog restriction to documents. (Yugo Nagata)
- Add NOTICE message handling to s_do_auth(). (Tatsuo Ishii)
Without this, health check responses false alarm and causes failover.
per bug track:
#25 s_do_auth doesn't handle NoticeResponse (N) message
Date: 2012-08-28 03:57
Reporter: singh.gurjeet
Date:
http://www.pgpool.net/mantisbt/view.php?id=25
- Remove unnecessary/confusing debug log from s_do_auth().(Tatsuo Ishii)
- Fix buffer overrun in Execute when memory cache enabled.
(Tatsuo Ishii)
If one of bind parameter < 0, it was possible to produce more than 2
byte string for "%02X" due to sign extension.
Also use snprintf, rather than sprintf to prevent from possible buffer
overrun in the future.
- Fix long standing memory leak bug with free_select_result() since
pgpool-II 2.3 was born in December 2009. (Tatsuo Ishii)
Actually this bug only appears when operated in replication mode
(triggered by timestamp rewriting process by coincidence).
Per bug track #24:
#24 Severe memory leak in an OLTP environment
Date: 2012-08-28 03:43
Reporter: singh.gurjeet
Date:
http://www.pgpool.net/mantisbt/view.php?id=24
- Fix typo in cache_reporting(). (Tatsuo Ishii)
- Fix infinite loop in SSL mode. (Tatsuo Ishii)
When there's pending data in SSL layer of frontend, pool_process_query()
checks pending data in backend. If there's non, it loops again and checks
frontend/backend receive buffer by using is_cache_empty().
Unfortunately it first checks pending data in SSL layer of frontend,
thus goes to backend data and checks again (infinite loop).
The solution is, if there's pending data in SSL layer of frontend and
query is not in progress, call ProcessFrontendResponse() to process new
request from frontend.
- Fix is_system_catalog() to use pgpool_regclass if available.
(Tatsuo Ishii)
- Fix memory leak in pool_get_insert_table_name(). (Tatsuo Ishii)
If session context's memory contex is used for nodeToString(), memory is
not freed until session ends.
See bug track #24 for more details.
#24 Severe memory leak in an OLTP environment
Date: 2012-08-28 03:43
Reporter: singh.gurjeet
http://www.pgpool.net/mantisbt/view.php?id=24
- Use fcntl(2) rather than flock(2) to lock oid map files. (Tatsuo Ishii)
flock(2) is not portable and cannot be used on Solaris.
Patch contributed by Ibrar Ahmed.
- Fix oversight of get_next_master_node() when operated in raw mode.
(Tatsuo Ishii)
If master node goes down, it always returned master node id 0.
See [pgpool-general: 1039] for more details.
[pgpool-general: 1039] Raw failover not working as expected on pgpool-II
v3.2.0
From: Quentin White
Date: Tue, 25 Sep 2012 07:45:34 +0000
http://www.sraoss.jp/pipermail/pgpool-general/2012-September/001057.html
- Fix segfault of do_query(). (Tatsuo Ishii)
When memqcache enabled and extended protocol is used, do_query()
accesses system catalog and use pool_read2(). Unfortunately parse message
packet is given to Parse() and the packet contents is on pool_read2's
buffer. Thus do_query could break the packet contents, and it leads to
segfault.
Solution is, allocate memory and copies the packet contents and pass to
Parse(). Note that query context holds query string, which is in the
packet as well. So we need to copy it and save the pointer in the
query context.
We think the problem is not only with Parse() but with other protocol
modules. So this fix is not Parse() only, rather for other modules. For
this purpose ProcessFrontendResponse() is changed.
See bugtrack in detail.
#21 pgpool-II 3.2.0 cannot execute sql through jdbc
Date: 2012-08-17 16:31
Reporter: elisechiang
http://www.pgpool.net/mantisbt/view.php?id=21
- Fix to set unix domain socket path for pgpool PCP communication before
setting up signal handlers. (Yugo Nagata)
Previously, unlink of the socket in exiting process was failed because
the path of the socket was not set.
Patch contributed by Gilles Darold
[pgpool-hackers: 131] Found bug with watchdog resulting in pgpool
segmentation fault
From: Gilles Darold
Date: Thu, 13 Sep 2012 18:54:42 +0200
http://www.sraoss.jp/pipermail/pgpool-hackers/2012-September/000130.html
- Fix to output the message when, in watchdog, ifup/down or arping command
does not exist. (Yugo Nagata)
- Fix long standing problem with do_query(). (Tatsuo Ishii)
When 1) extended protocol used and 2)unnamed portal is used and 3) no
explicit transaction is used, user's unnamed portal is removed by Sync
message.
This is because Sync message closes transaction and unnamed portal is
removed. This leads to "portal "" does not exist" error.
Fix is, use "Flush" message instead of Sync. Main difference between
using Sync and Flush is, Flush does not return Ready for Query message.
So do_query() does not return until all expected responses are returned.
It seems the order of messages returned from backend is random, and
do_query () manages it by using state bits.
===============================================================================
3.2.0 (namameboshi) 2012/08/03
* Version 3.2.0
This is the first version of pgpool-II 3.2 series.
That is, a "major version up" from 3.1 series.
__________________________________________________________________
* Incompatible changes
- The new query cache "On memory query cache" took the place of the old
one.
- Now the parameter "enable_query_cache" is deleted.
__________________________________________________________________
* New features
** Memory based query cache
Original author is Masanori Yamazaki, improved by Development Group.
(Tatsuo Ishii, Nozomi Anzai, Yugo Nagata)
Overview:
On memory query cache is faster because cache storage is on memory.
Moreover you don't need to restart pgpool-II when the cache is outdated
because the underlying table gets updated.
On memory cache saves pair of SELECT statements (with its Bind parameters
if the SELECT is an extended query). If the same SELECTs comes in, it
returns the value from cache. Since no SQL parsing nor access to
PostgreSQL are involved, it's extremely fast.
On the other hand, it might be slower than the normal path because it
adds some overhead to store cache. Moreover when a table is updated,
pgpool automatically deletes all the caches related to the table. So the
performance will be degraded by a system with a lot of updates. If the
cache_hit_ratio is lower than 70%, you might want to disable onl memory
cache.
Choosing cache storage:
You can choose a cache storage: shared memory or memcached (you can't use
the both).
Query cache with shared memory is fast and easy because you don't have
to install and config memcached, but restricted the max size of cache by
the one of shared memory. Query cache with memcached needs a overhead to
access network, but you can set the size as you like.
Restrictions:
- On memory query cache deletes the all cache of an updated table
automatically with monitoring if the executed query is UPDATE, INSERT,
ALTER TABLE and so on. But pgpool-II isn't able to recognize implicit
updates due to triggers, foreign keys and DROP TABLE CASCADE.
You can avoid this problem with memqcache_expire by which pgpool deletes
old cache in a fixed time automatically, or with black_memqcache_table_list
by which pgpool's memory cache flow ignores the tables.
- If you want to use multiple instances of pgpool-II with online memory
cache which uses shared memory, it could happen that one pgpool deletes
cache, and the other one doesn't do it thus finds old cached result
when a table gets updated. Memcached is the better cache storage in this
case.
New parameters:
- Add parameters for on memory query cache as follows:
memory_cache_enabled, memqcache_method, memqcache_expire,
memqcache_maxcache, memqcache_oiddir. (Tatsuo Ishii)
- Add parameters about shared memory for on memory query cache as
follows:
memqcache_total_size, memqcache_max_num_cache,
memqcache_cache_block_size. (Tatsuo Ishii)
- Add parameters about memcached for on memory query cache as follows:
memqcache_memcached_host, memqcache_memcached_port. (Tatsuo Ishii)
- Add parameters about relation cache for on memory query cache as
follows:
relcache_expire, relcache_size. (Tatsuo Ishii)
- Add a parameter "check_temp_table" to check if the SELECTed table is
temp table. (Tatsuo Ishii)
- Add the parameters of white_memqcache_table_list,
black_memqcache_table_list that check if the SELECTed tables, temp
tables and views are to be cached or not. (Nozomi Anzai)
- Add a parameter "memqcache_auto_cache_invalidation" of the flag if
query cache is triggered by corresponding DDL/DML/DCL (and
memqcache_expire). (Yugo Nagata)
New commands:
- Add "SHOW pool cache" which shows hit ratio of query cache and the
status of cache storage.
- Add "--with-memcached" option to configure. (Nozomi Anzai)
- Add "-C, --clear-oidmaps" option to "pgpool" command. (Nozomi Anzai)
If pgpool with memcached starts / restarts with -C option, discard oid
maps, if not, it can reuse old oid maps and query caches.
** Watchdog
The author is Atsushi Mitani, tested by Yugo Nagata.
Overview:
"Watchdog" is a sub process of pgpool-II aiming for adding high
availability feature to it. Features added by watchdog include:
- Life checking of pgpool service
Watchdog monitors responses of pgpool service rather than process. It
sends queries to PostgreSQL via pgpool which is being monitored by
watchdog and watchdog checks the response. Also watchdog monitors
connections to up stream servers (application servers etc.) from the
pgpool. The connection between the up stream servers and the pgpool is
monitored as service of pgpool.
- Mutual monitoring of watchdog processes
Watchdog processes exchange information on the monitored servers to
keep the information up to date, and to allow watchdog processes to
mutually monitor each other.
- Changing active/standby state in case of certain faults detected
When a fault is detected in the pgpool service, watchdog notifies the
other watchdogs of it. Watchdogs decide the new active pgpool if
previous active pgpool is broken by voting and change active/standby
state.
- Automatic virtual IP address assigning synchronous to server switching
When a standby pgpool server promotes to active, the new active server
brings up virtual IP interface. Meanwhile, the previous active server
brings down the virtual IP interface. This enables the active pgpool to
work using the same IP address even when servers is switched over.
- Automatic registration of a server as standby in recovery
When broken server recovers or new server is attached, the watchdog
process notifies the other watchdog process along with information of
the new server, and the watchdog process receives information on the
active server and other servers. Then, the attached server is
registered as standby.
New parameters:
- Add a parameter to enable watchdog: use_watchdog. (Atsushi Mitani)
- Add the parameters about life checking of pgpool service as follows:
wd_interval,other_pgpool_port wd_life_point, wd_lifecheck_query,
other_pgpool_hostname, other_pgpool_port. (Atsushi Mitani)
- Add the parameters about up to stream connection (e.g. to application
servers) as follows:
trusted_servers, ping_path. (Atsushi Mitani)
- Add the parameters about mutual monitoring of watchdog processes
as follows:
wd_hostname, wd_port, other_wd_port. (Atsushi Mitani)
- Add the parameters about virtual IP as follows:
ifconfig_path, if_up_cmd, if_down_cmd, arping_path, arping_cmd.
(Atsushi Mitani)
__________________________________________________________________
* Enhancements
- Retry if health check failed rather than immediately do failover. For
this purpose new directives "health_check_max_retries" and
"health_check_retry_delay" were added. (Tatsuo Ishii)
Patch contributed by Matt Solnit.
Subject: [Pgpool-hackers] Health check retries (patch)
From: Matt Solnit
Date: Fri, 18 Nov 2011 16:28:44 -0500
- Log client IP and port number when pgpool failed to parse given query.
(Tatsuo)
This is useful to identify which client gives wrong query without
enabling log_connections, which produces too many log entries on busy web
systems.
- Refactor pool_process_query(). (Tatsuo Ishii)
Deal with the case when:
1) query not in progress
2) other than master node has pending data.
It is reported that pgpool goes into infinite loop in this case.
[pgpool-general: 43]
Re: [Pgpool-general] seemingly hung pgpool process consuming 100% CPU
http://www.pgpool.net/pipermail/pgpool-general/2011-December/000042.html
- Add "role" which represents "primary" or "standby" iin streaming
replication mode for example to "SHOW pool_nodes" command.(Tatsuo Ishii)
- Add params to the result of "SHOW pool_status": backend_data_directory,
ssl_ca_cert, ssl_ca_cert_dir, and sort by orders in pgpool.conf. (Anzai)
- Commentout params about system db from pgpool.conf.sample-*. (Nozomi Anzai)
- Add new parameter to failover/failback/followmaster command. (Tatsuo Ishii)
%r: new master port number
%R: new master database cluster path
- Allow to reload to recognize md5 password change. (Tatsuo Ishii)
Before, the only way to recognize md5 password change was restarting
pgpool-II. Patch contributed by Gurjeet Singh.
- Remove unused parameter "query" from is_set_transaction_serializable().
(Tatsuo Ishii)
- Fix on memory query cache section's comments in pgpool.com in the way
which other sections employ. (Tatsuo Ishii)
- Add missing health_check_max_retries and health_check_retry_delay
directives to pgpool.conf.sample-master-slave, pgpool.conf.sample-replication
pgpool.conf.sample-stream. (Tatsuo Ishii)
- Fix pool_ssl_write. It seems someone forgot to do retrying when SSL
returns SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE.
Per [pgpool-general: 797]
[pgpool-general: 797]
Re: Problem with pgpool when using SSL, for client/pgpool communication
http://www.sraoss.jp/pipermail/pgpool-general/2012-July/000807.html
- Improve the design of manuals. (Nozomi Anzai)
__________________________________________________________________
* Bug Fix
- Fix memory leak in Raw mode.(Tatsuo Ishii)
- Fix failover/failback in Raw mode. (Tatsuo Ishii)
- Simply does not failover if target node is not master.
- Fail to select master node if the node is in CON_UP.
- Allow health check retry while connect(). (Tatsuo Ishii)
It is reported that connect() blocks sigalarm under some conditions, for
example: When system is configured for security reasons not to return
destination host unreachable messages ([pgpool-general: 131])
Part of changes are contributed by Stevo Slavic.
[pgpool-general: 131] Healthcheck timeout not always respected
http://www.pgpool.net/pipermail/pgpool-general/2012-January/000131.html
- Fix pool_send_and_wait() to send or not to send COMMIT / ABORT depending
on the transaction state on each node. (Tatsuo Ishii)
It is possible that only primary is in an explicit transaction but
standby is not in it if multi statement query has been sent.
Per bug report [pgpool-general-jp: 1049].
- Fix load balance in Solaris. (Tatsuo Ishii)
Problem is, random() in using random() in Solaris results in strange
load balancing calculation.
Use srand()/rand() instead although they produce lesser quality random
Problem reported at [pgpool-general: 396].
[pgpool-general: 396] strange load balancing issue in Solaris
http://www.pgpool.net/pipermail/pgpool-general/2012-April/000397.html
- Fix segfault of pcp_systemdb_info not in parallel mode. (Nozomi Anzai)
- Fix "unnamed prepared statement does not exist" error. (Tatsuo Ishii)
This is caused by pgpool's internal query, which breaks client's unnamed
statements. To fix this, if extended query is used, named
statement/portal for internal are used for internal query.
- Fix hangup when query conflict occurs in Hot-Standby mode. (Yugo Nagata)
Query example to reproduce:
(S1) BEGIN;
(S1) SELECT * FROM t;
(S2) DELETE FROM t;
(S2) VACUUM t;
- Fix pool_process_query() bug reported in [pgpool-general: 672].
(Tatsuo Ishii)
This is caused by the function waits for primary node which does not
have pending data, while standbys have pending data.
[pgpool-general: 672] Transaction never finishes
http://www.pgpool.net/pipermail/pgpool-general/2012-June/000676.html
- Fix wait_for_query_response() not to send param status to frontend if
frontend is NULL. (Tatsuo Ishii)
This could happen while processing reset_query_list and occur crash.
- Fix bug with treatment of BEGIN TRANSACTION in master/slave mode.
(Tatsuo Ishii)
Original complain is [pgpool-general: 714].
From 3.1, pgpool-II sends BEGIN.. to all DB nodes. Of course we cannot
send BEGIN TRANSACTION READ WRITE to standby nodes.
Problem is, we did not check BEGIN WORK ISOLATION LEVEL SERIALIZABLE;
and sent to standby nodes. Of course this is wrong, since it's not
allowed to run transactions in serializable mode on standby nodes.
So added check for BEGIN WORK ISOLATION LEVEL SERIALIZABLE case.
[pgpool-general: 714]
Load Balancing / Streaming Replication / Isolation Level serializable
http://www.pgpool.net/pipermail/pgpool-general/2012-July/000719.html
- Fix send_to_where() to send the query to only primary if the it is like
SET TRANSACTION ISOLATION LEVELSERIALIZABLE etc. (Tatsuo Ishii)
Case in streaming replication mode. Previously, it was sent to not only
primary but also to standby and of course this causes an error.
Similar SQLs are:
SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE or
SET transaction_isolation TO 'serializable'
SET default_transaction_isolation TO 'serializable'
Original complain is [pgpool-general: 715].
[pgpool-general: 715]
Re: Load Balancing / Streaming Replication / Isolation Level serializable
http://www.pgpool.net/pipermail/pgpool-general/2012-July/000720.html
- Prevent errors even if memcached is not available with on memory query
cache enabled and cache storage is memcached. (Tatsuo Ishii)
This is mainly achieved by modifying pool_fetch_cache to pretend
"cache not found" if memcached_get returns error other than
MEMCACHED_NOTFOUND. Also we set pool_config->memory_cache_enabled to 0 to
prevent future errors by accessing memcached.
- Run rerun libtoolize with --copy and --force option. (Tatsuo Ishii)
This should prevent build problems in different environment.
Following commands were executed:
libtoolize --copy --force
aclocal
autoheader
automake -a
autoconf
- Fix pool_ssl_read. (Tatsuo Ishii)
When SSL_read returns unknown error, treat as if EOF detected and returns 0
to caller (pool_read). This is same as libpq's behavior. Also this will
avoid unwanted failover in pool_read. pool_read triggers failover if
underlying I/O functions, read(2) or pool_ssl_read returns -1.
- Fix pool_process_query. (Tatsuo Ishii)
When other than primary sends packet, pgpool tries to terminate session
gracefully and hung because now ssl_read returns EOF, rather than error
and triggers failover. For example [pgpool-general: 766] reported this:
2012-07-17 00:11:03 NZST [15692]: [257-1] ERROR: canceling statement
due to conflict with recovery
2012-07-17 00:11:03 NZST [15692]: [258-1] DETAIL: User query might
have needed to see row versions that must be removed.
2012-07-17 00:11:03 NZST [15692]: [259-1] STATEMENT: <SNIP>
2012-07-17 00:11:03 NZST [15696]: [366-1] FATAL: terminating
connection due to conflict with recovery
2012-07-17 00:11:03 NZST [15696]: [367-1] DETAIL: User query might
have needed to see row versions that must be removed.
In this case pool_process_query should return POOL_ERROR, rather than
POOL_END.
[pgpool-general: 766]
Re: pgpool dropping backends too much
http://www.pgpool.net/pipermail/pgpool-general/2012-July/000774.html
- If frontend terminates while reading large number of query results
from backend, pgpool continues to read from backend and write to
frontend until all query results consumed. (Tatsuo Ishii)
This will take very long time if query results is huge. To finish pgpool
session as soon as possible, modify pool_flush_it to returns error if
fail to write to frontend when operated in other than replication mode.
In replication mode, we need to keep the previous behavior to save
consistency among backends).
Also fix SimpleForwardToFrontend to return pool_write_and_flush error
status. Before it was ignored.
===============================================================================
3.1 Series (2011/09/08 - )
===============================================================================
3.1.20 (hatsuiboshi) 2016/08/31
* Version 3.1.20
This is a bugfix release against pgpool-II 3.1.19.
__________________________________________________________________
* Bug fixes
- Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii)
While processing "show pool_nodes", the buffer for hostname was too
short. It should be same size as the buffer used for pgpool.conf.
Problem reported by a twitter user who is using pgpool on AWS (which
could have very long hostname).
- Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii)
The usage of wait(2) in pgpool main could cause infinite wait in the
system call. Solution is, to use waitpid(2) instead of wait(2).
- Fix "kind mismatch" error message in pgpool. (Muhammad Usama)
Many of "kind mismatch..." errors are caused by notice/warning
messages produced by one or more of the DB nodes. In this case now
Pgpool-II forwards the messages to frontend, rather than throwing the
"kind mismatch..." error. This would reduce the chance of "kind
mismatch..." errors.
See [pgpool-hackers: 1501] for more details.
- Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii)
The macro calls pool_virtual_master_db_node_id() and then access
backend->slots[id]->con using the node id returned. In rare cases, it
could point to 0 (in case when the DB node is not connected), which
gives access to con->major, then it causes a segfault.
See bug 225 for related info.
- doc : fix Japanese document typo. (Bo Peng)
- Fixing a typo in the log message. (Muhammad Usama)
- doc : Add comment to the document about connection_cache. (Tatsuo Ishii)
===============================================================================
3.1.19 (hatsuiboshi) 2016/06/17
* Version 3.1.19
This is a bugfix release against pgpool-II 3.1.18.
__________________________________________________________________
* Bug fixes
- Fix is_set_transaction_serializable() when
SET default_transaction_isolation TO 'serializable'. (Bo Peng)
SET default_transaction_isolation TO 'serializable' is sent to
not only primary but also to standby server in streaming replication mode,
and this causes an error. Fix is, in streaming replication mode,
SET default_transaction_isolation TO 'serializable' is sent only to the
primary server.
See bug 191 for related info.
- Fix Chinese documentation bug about raw mode (Yugo Nagata, Bo Peng)
Connection pool is available in raw mode.
- Fix confusing comments in pgpool.conf (Tatsuo Ishii)
- Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama)
Currently TLSv1_method() is used to initialize the SSL context, that puts an
unnecessary limitation to allow only TLSv1 protocol for SSL communication.
While postgreSQL supports other ciphers protocols as well. The commit changes
the above and initializes the SSLSession using the SSLv23_method()
(same is also used by PostgreSQL). Because it can negotiate the use of the
highest mutually supported protocol version and remove the limitation of one
specific protocol version.
- If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii)
query to primary node, and all of following user queries are sent to
standby, it is possible that the next command, for example END, could
cause a statement timeout error on the primary, and a kind mismatch
error on pgpool-II is raised.
This fix tries to mitigate the problem by sending sync message instead
of flush message in do_query(), expecting that the sync message reset
the statement timeout timer if we are in an explicit transaction. We
cannot use this technique for implicit transaction case, because the
sync message removes the unnamed portal if there's any.
Plus, pg_stat_statement will no longer show the query issued by
do_query() as "running".
See bug 194 for related info.
- Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if
primary is not node 0, then statement timeout could occur even after
bug194-3.3.diff was applied. After some investigation, it appeared
that MASTER macro could return other than primary or load balance
node, which was not supposed to happen, thus do_query() sends queries
to wrong node (this is not clear from the report but I confirmed it in
my investigation).
pool_virtual_master_db_node_id(), which is called in MASTER macro
returns query_context->virtual_master_node_id if query context
exists. This could return wrong node if the variable has not been set
yet. To fix this, the function is modified: if the variable is not
either load balance node or primary node, the primary node id is
returned.
- change the Makefile under the directory src/sql/, that is proposed (Bo Peng)
by [pgpool-hackers: 1611]
- Fix a possible hang during health checking (Yugo Nagata)
Health checking was hang when any data wasn't sent
from backend after connect(2) succeeded. To fix this,
pool_check_fd() returns 1 when select(2) exits with
EINTR due to SIGALRM while health checking is performed.
Reported and patch provided by harukat and some modification
by Yugo. Per bug #204.
backported from 3.4 or later;
https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=ed9f2900f1b611f5cfd52e8f758c3616861e60c0
- Fix bug with load balance node id info on shmem (Tatsuo Ishii)
There are few places where the load balance node was mistakenly put on
wrong place. It should be placed on: ConnectionInfo *con_info[child
id, connection pool_id, backend id].load_balancing_node]. In fact it
was placed on: *con_info[child id, connection pool_id,
0].load_balancing_node].
As long as the backend id in question is 0, it is ok. However while
testing pgpool-II 3.6's enhancement regarding failover, if primary
node is 1 (which is the load balance node) and standby is 0, a client
connecting to node 1 is disconnected when failover happens on node
0. This is unexpected and the bug was revealed.
It seems the bug was there since long time ago but it had not found
until today by the reason above.
===============================================================================
3.1.18 (hatsuiboshi) 2016/04/26
* Version 3.1.18
This is a bugfix release against pgpool-II 3.1.17.
__________________________________________________________________
* Bug fixes
- Removing the limit on the maximum number of items in the
black_function_list and white_function_list lists. (Muhammad Usama)
extract_string_tokens in pool_config uses the fixed size malloc on
the array to hold the black_function_list/white_function_list items.
This imposes a limit of maximum items in these lists.
The fix is to use realloc to increase the array size when it gets full.
- Redirect all user queries to primary server (Tatsuo Ishii)
Up to now some user queries are sent to other than the primary server
even if load_balance_mode = off. This commit changes the behavior: if
load_balance_mode = off in streaming replication mode, now all the
user queries are sent to the primary server only.
Per bug #189.
- Change the PID length of pcp_proc_count command result to 6 characters
long (Bo Peng)
If the pgpool process ID are over 5 characters, the 6th character of each
process ID will be removed. This commit changes the process ID length of
pcp_proc_count command result to 6 characters long.
Per bug #188.
===============================================================================
3.1.17 (hatsuiboshi) 2016/04/04
* Version 3.1.17
This is a bugfix release against pgpool-II 3.1.16.
__________________________________________________________________
* Bug fixes
- doc: Change description of backend_flag (Tatsuo Ishii)
It is pointed out that restarting pgpool-II is not necessary.
Per [pgpool-general-jp: 1394].
- doc: Fix installation procedure. (Tatsuo Ishii)
With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed.
- Fix to validate the PCP packet length (Muhammad Usama)
Without the validation check, a malformed PCP packet can crash the
PCP child and/or can run the server out of memory by sending the packet
with a very large data size.
- Fix a reset query stuck problem (Muhammad Usama)
The solution is to return POOL_END_WITH_FRONTEND_ERROR instead of
POOL_END when pool_flush on front-end socket fails.
The original report is
[pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL
===============================================================================
3.1.16 (hatsuiboshi) 2016/02/05
* Version 3.1.16
This is a bugfix release against pgpool-II 3.1.15.
__________________________________________________________________
* Bug fixes
- doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii)
In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent
to primary node only. Pointed out in [pgpool-general-jp: 1378].
- Issue fsync() when writing pgpool_status (Tatsuo Ishii)
This ensures that pgpool_status is saved to permanent storage and
allow to survive after system crash.
- doc: Fix wrong description about log_standby_delay in the document
(Yugo Nagata)
- Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii)
Pgpool-II remembers that non read only queries (including SET) were
executed in an explicit transaction and adds a "writing transaction"
mark to the transaction. The mark affects the query routing behavior
of pgpool-II while running in streaming replication mode. Pgpool-II
starts sending queries to the primary after the mark is set. Because
the effect of writing queries may appear on standbys after some delay
in streaming replication mode, it is safer to route read queries to
the primary after the mark is set.
However there's oversight here. "SET TRANSACTION READ ONLY" does no
data modification and should be treated as an exception.
Per bug #157.
- Fix FATAL error with reloading (Tatsuo Ishii)
While reloading pgpool.conf, the number of DB nodes is tentatively set
to 0, then counted up until reaching to the actual number of backends
by the pgpool main process. Unfortunately the variable was on the
shared memory and it confused pgpool child process when they were using
the variable and this caused FATAL error.
Per bug #156 report by harukat.
- Ignore close statement/portal request if they do not exist (Tatsuo Ishii)
In this case just returns a close complete message to client.
This is a back port of the following commit from pgpool-II 3.4:
1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0
===============================================================================
3.1.15 (hatsuiboshi) 2015/07/24
* Version 3.1.15
This is a bugfix release against pgpool-II 3.1.14.
__________________________________________________________________
* Bug fixes
- Fix "cannot find xlog functions" error in pgpool-recovery
(Muhammad Usama)
The argument data type of PostgreSQL's pg_xlogfile_name() function
has been changed from text to pg_lsn since PostgreSQL 9.4. And
pgpool-recovery was still trying to locate the function by old
signature.
- Do not send a query for checking insert lock in non replication mode
with extended query (Tatsuo Ishii)
===============================================================================
3.1.14 (hatsuiboshi) 2015/04/08
* Version 3.1.14
This is a bugfix release against pgpool-II 3.1.13.
__________________________________________________________________
* Bug fixes
- Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii)
This is used in show pool_status command and limits the length of
parameter description. Unfortunately recovery_timeout description is
64 chars, which is 1 byte longer than former definition of the macro.
- Support SSL certificate chains in the certificate file for incoming
frontend connections (Muhammad Usama)
- Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama)
When graceful node detach is requested gracefully, pcp_detach_node should
check if it is allowed to process detach_node command on the particular
node before blocking the incoming connections and closing the existing
connections.
===============================================================================
3.1.13 (hatsuiboshi) 2015/02/05
* Version 3.1.13
This is a bugfix release against pgpool-II 3.1.12.
__________________________________________________________________
* Bug fixes
- doc: Describe explicitly that the number of slave nodes is not
necessarily 1 (Tatsuo Ishii)
- Fix uninitialized variable (Tatsuo Ishii)
Per Coverity 1234603.
- doc: Fix missing release note entries in the previous release
(Tatsuo Ishii)
- Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii)
The node id should be lower than NUM_BACKENDS. Probably harmless since
callers never pass node ids greater or equal to NUM_BACKENDS.
- Fix to disable debug mode by reloading config (Yugo Nagata)
Per bug #114
http://www.pgpool.net/mantisbt/view.php?id=114
===============================================================================
3.1.12 (hatsuiboshi) 2014/09/05
* Version 3.1.12
This is a bugfix release against pgpool-II 3.1.11.
__________________________________________________________________
* Bug fixes
- Fix a typo of pgpool.spec (Yugo Nagata)
- Fix bug that worker child process keeps failing when there's no
primary backend (Tatsuo Ishii)
Problem identified and fix contributed by Junegunn Choi.
See [pgpool-hackers: 471] for more details.
- Close listen socket when smart shutdown request is made (Tatsuo Ishii)
When smart shutdown process starts, pgpool children still listen on
the port and clients can send further connection requests which fail
in the end. Which is not only waste of time, but also prevents a load
balancer which sits in front of pgpool from realizing the pgpool is
going down.
Problem analyzed and patch provided by Junegunn Choi in [pgpool-hackers
474], and enhanced to take care not only inet domain socket but UNIX
domain socket by Tatsuo Ishii.
- doc: Add cautions that recovery commands are killed by statement_timeout
of PostgreSQL. (Tatsuo Ishii)
- doc: Remove old restriction description which is no longer true
(Tatsuo Ishii)
- Fix return type of text_to_lsn() function (Yugo Nagata)
This caused compile warning.
- Fix file descriptor leak when daemonize. (Tatsuo Ishii)
Per Coverity 1111471.
- Fix memory leak. (Tatsuo Ishii)
Per Coverity 1111442.
- Fix pgpool.init's long-standing bug of stop/restart failure
(Yugo Nagata)
In previous, pgpool.init uses killproc for stopping pgpool, but there
are several problems. In the new version, "pgpool -m fast stop" is
used in stop command.
Original patch contributed by Ryan DeShone and modified by Yugo Nagata.
See [pgpool-hackers: 239][pgpool-hackers: 512].
- Disable statement_timeout of PostgreSQL while executing online recovery
(Tatsuo Ishii)
Online recovery may take very long time and user may enable statement
timeout. To prevent online recovery canceled by statement timeout,
disable statement timeout in the connection used by online recovery.
See [pgpool-general: 2919] for more details.
- Remove unnecessary call to pool_shmem_exit() which removes semaphore
when it shouldn't (Tatsuo Ishii)
exit_handler checks if the process is parent or not. This is
good. However, even if it is a child process, it calls
pool_shmem_exit() which removes semaphore and shmem when it should
not. It should be called only from parent process.
Per bug #102.
http://www.pgpool.net/mantisbt/view.php?id=102
- Fix reset query stuck problem. (Tatsuo Ishii)
It is reported that reset query (DISCARD ALL etc.) occasionally does
not finish and pgpool child remain waiting for reply from backend thus
client cannot connect to pgpool.
The cause of problem is not identified yet but if client suddenly
closes connection to pgpool in the middle of query processing, backend
may not accept the reset queries because they are not ready for query.
The fix is, if frontend closes connection in unexpected way, query
process loop immediately returns with new state:
POOL_END_WITH_FRONTEND_ERROR and pgpool closes connection to
PostgreSQL then goes back to new connection request waiting loop.
Also, pgpool closes connections to backend when client_idle_limit is
set and the idle limit.
Per bug #107.
http://www.pgpool.net/mantisbt/view.php?id=107
===============================================================================
3.1.11 (hatsuiboshi) 2014/03/24
* Version 3.1.11
This is a bugfix release against pgpool-II 3.1.10.
__________________________________________________________________
* Bug fixes
- doc: Add mention about "listen queue" and how to increase the "backlog"
in the num_init_children section. (Tatsuo Ishii)
- Fix bad performance of unlogged tables detection code. (Tatsuo Ishii)
Pointed out at [pgpool-hackers: 435][[pgpool-general:2325].
- Fix primary node detection logic. (Tatsuo Ishii)
There's a possibility that primary node is not detected. This happens
in following situation. node 0: primary, node 1: standby. Node 0 goes
down. Health checking detects the fact but local status is not updated
yet. Primary node finding (find_primary_node) runs. Node 0's status is
yet healthy. Because find_primary_node fails to connect to node 0, it
immediately returns -1 and fails to find that fact that node 1 is now
primary.
Fix is just continuing to look for primary node when fails to connect
to a node.
Per [pgpool-general: 2409].
- Fix jdbc DML fails when operated in raw mode and auto commit is off.
(Tatsuo Ishii)
This is reported in bug #92.
- Avoid to send queries to unrelated nodes in streaming replication mode.
(Tatsuo Ishii)
Pgpool-II sends certain queries, such as BEGIN, END and SET commands to
all of DB nodes. However in streaming replication mode, only primary
node and at most one standby node are only concerned (if primacy node
is selected as the load balance node, only 1 node is concerned).
See [pgpool-hackers: 464] for more details.
- Fix possible buffer overrun problem and memory leak. (Tatsuo Ishii)
Per Coverity 1111465 and 1111482.
- Fix possible buffer overrun. (Tatsuo Ishii)
Replace strcpy() with strlcpy(). Per Coverity report 1111478, 1111480,
1111481.
- Fix freeing NULL. (Tatsuo Ishii)
Per Coverity 1111384.
- Fix memory leak. (Tatsuo Ishii)
Per Coverity 1111446.
- Fix a segmentation fault in parallel mode with system_db_hostname is
empty (Yugo Nagata)
- Fix to output debug messages in processing pgpool.conf with -d option
(Yugo Nagata)
Previously, some debug messages in pool_get_config() ware not output
even when -d option was used.
- Fix JDBC exception of prepared statement including now() in
replication mode (Yugo Nagata)
With JDBC, when a prepared statement is executed more than
PrepareThreshold times, the statement is named and Describe message
is sent after Parse. With named statement, pgpool rewrite now() to
parameter in replication mode. Hence, rewritten query has additional
parameter than original. In this case, ParameterDescription message
sent to frontend (response of Describe) should include OIDs of the
same number os original query's parameters. Otherwize, JDBC throws
ArrayIndexoutOfBoundsException.
This is reported in [pgpool-general-jp: 1192].
- Fix backend error of prepared statement about table which has column whose
default value is now() in replication mode (Yugo Nagata)
When pgpool parses a named prepared statement with default now(),
timestamps are replaced to additional parameters. So, Bind message also
should included additional parameter format codes. However, when the
number of original parameter was one, pgpool didn't handle this. This
caused a error like "incorrect binary data format in bind parameter 2".
- doc: Add description about parallel mode doesn't support PREPARE (Yugo Nagata)
Per bug #93
===============================================================================
3.1.10 (hatsuiboshi) 2013/12/06
* Version 3.1.10
This is a bugfix release against pgpool-II 3.1.9.
__________________________________________________________________
* Bug fixes
- Fix incorrect time stamp rewriting in replication mode for certain time
zones. (Tatsuo Ishii)
Time stamp rewriting calls "SELECT now()" to get current time.
Unfortunately the buffer for the current time is too small for certain
time zones such as "02:30". Note that non-30-minutes-time-zone such as
"0900" does not reveal the problem. This explains why we haven't the bug
report until today.
Bug reported in [pgpool-general: 2113] and fix provided by Sean Hogan.
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002142.html
- Makefile: Replace pg_config by $(PG_CONFIG) in Makefiles so it can be
overridden at build time when compiling for different PG major versions.
(Tatsuo Ishii)
Patch contributed by Christoph Berg ([pgpool-general: 2127]).
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html
- configure: Remove -lcompat because it confuses FreeBSD per bug#15.
(Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=15
- Fix segfault when pgpool.conf does not set log_standby_delay.
(Tatsuo Ishii)
This is caused by wrong initialization for log_standby_delay in
pool_config.l.
Per bug#74. http://www.pgpool.net/mantisbt/view.php?id=74
- doc: Modify descriptions about restrictions of parallel mode
Multiple rows INSERT using VALUES are not supported in parallel mode.
(Yugo Nagata)
- Avoid calling find_primary_node_repeatedly() when standby node goes
down. (Tatsuo Ishii)
This will reduce the time to failover. Per bug #75, patch modified by
Tatsuo Ishii. http://www.pgpool.net/mantisbt/view.php?id=75
- Fix data inconsistency problem with native replication mode + extended
protocol case. (Tatsuo Ishii)
It is reported that concurrent INSERT using JDBC driver causes data
difference among database node. This only happens following conditions
are all met:
1) Native replication mode
2) Extended protocol used
3) The portal created by parse message is reused by bind message
4) autocommit is on
5) SERIAL (sequence) is used
Pgpool-II's parse message function knows it has to lock the target
table when INSERT (plus #5) is issued by clients. Unfortunately bind
message function did not know it. Once parse/bind/execute finishes,
pgpool releases the lock obtained by parse because of #4. JDBC wants
to reuse the portal and starts the cycle from bind message, which does
not obtain lock. As as result, lock-free INSERT are floating around
which causes data inconsistency of course. The solution is, lock the
table in bind phase.
For this bind needs to issue LOCK in extended protocol. This was a little
bit hard because the module (do_command()) to issue internal SQL command
(other than SELECT) does not support extended protocol.
To solve the problem do_query() is modified so that it accepts other than
SELECT because it already accepts extended protocol.
The modification is minimum and is only tested for the case called from
insert_lock(). I do not recommend to replace every occurrence of
do_command () with do_query() at this point.
BTW the reason why the bug is not reported is, most users uses JDBC
with auto commit = off. In this case, the lock obtained by parse persists
until user explicitly issues commit or rollback.
Per bug report by Steve Kuekes in [pgpool-general: 2142].
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002171.html
- Fix error message in read_password_packet(). (Tatsuo Ishii)
- Fix memory leak when do_query() fails in timestamp rewriting.
(Tatsuo Ishii)
For this purpose free_select_result() is changed to accept NULL argument.
Per Coverity report "1111454, 1111455 Resource leak".
- Fix target node selection logic when "DEALLOCATE portal|statement".
(Tatsuo Ishii)
When "DEALLOCATE portal|statement" is used and last prepared statement or
portal was not found, target node selection map is not set. Probably this
is not actually harmful because prepared statement or portal was not found
is an error case. The bug was there since day 0.
Per Coverity report "1111491 Structurally dead code".
- Fix range check bug of MAX_NUM_BACKENDS in corner case. (Tatsuo Ishii)
MAX_NUM_BACKENDS is the allowed max number of DB nodes (128, at this
point). In reality, probably no one ever tried more than 128 DB nodes
and that's the reason why nobody noticed.
Per Coverity report "1111429, 1111430 and 1111431 Out-of-bounds write".
- Fix that the script forgets to allow public access to pgpool_catalog.
(Tatsuo Ishii)
The bug prevents inserting data into user tables if pgpool_catalog is
created in native replication mode. The bug was there from day 1. I
wonder why nobody noticed until today.
Per [pgpool-general-jp: 1229].
http://www.sraoss.jp/pipermail/pgpool-general-jp/2013-November/001228.html
- Fix uninitialized variable in error case in pool_do_auth().
(Tatsuo Ishii)
If there's no valid backend, pgpool will return garbage pid to frontend in
auth phase. Actually because no backend is available, frontend will be
disconnected later on. So this is not harmless.
Per Coverity report "1127331 Uninitialized scalar variable".
- Fix to add node id range check when issue an error message using node
id. (Tatsuo Ishii)
Per Coverity report #1111433 "Out-of-bounds read".
- Fix buffer overrun bug and resource leak bug of parse_copy_data().
(Tatsuo Ishii)
Per Coverity report 1111427 "Out-of-bounds write" and 1111453 "Resource
leak".
- Fix possible segfault in CopyDataRaws(). (Tatsuo Ishii)
Coverity pointed out that if pool_get_id() returns an error, VALID_BACKEND
will access out of array.
Per Coverity report 1111413 "Memory - illegal accesses".
- Fix resource leak in make_persistent_db_connection. (Tatsuo Ishii)
For this purpose, new static function free_persisten_db_connection_memory
is added.
Per Coverity report #1111468.
===============================================================================
3.1.9 (hatsuiboshi) 2013/09/06
* Version 3.1.9
This is a bugfix release against pgpool-II 3.1.8.
__________________________________________________________________
* Bug fixes
- Fix a mistake in ssh command of doc/basebackup.sh (Tatsuo Ishii)
- Fix a bug in parsing prepared statements with transaction handling in
replication mode (Tatsuo Ishii)
Parse() automatically starts a transaction for non SELECT query to keep
consistency among nodes in replication mode. But this wasn't closed. If
wrong query comes in, the transaction goes into an abort state but pgpool
does not close the transaction. Thus next query causes error because the
transaction is still in abort status.
This problem was reported in [pgpool-general: 1877] by Sean Hogan.
[pgpool-general: 1877] current transaction is aborted, commands ignored
http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001905.html
- Fix typos of the japanese document (Yugo Nagata)
===============================================================================
3.1.8 (hatsuiboshi) 2013/07/10
* Version 3.1.8
This is a bugfix release against pgpool-II 3.1.7.
__________________________________________________________________
* Bug fixes
- Add mention about "-D" option to the man page. (Tatsuo Ishii)
- Consider timeout waiting for completion of failback request in on line
recovery (Tatsuo Ishii)
This will prevent the situation that recovery operation continues forever
and we cannot even shutdown pgpool-II main process. This could happen
especially while executing follow master command.
- Fix a bug that %H of follow_master_command is not assigned correctly the
new primary node in stream replication mode
(Tatsuo Ishii)
- Fix do_query() to not hang when PostgreSQL returns an error
(Tatsuo Ishii)
The typical symptom is "I see SELECT is keep on running according to
pg_stat_activity". To fix this pgpool-II just exits the process and
kill the existing connection. This is not gentle but at this point I
believe this is the best solution.
- Fix bug with do_query which causes hung in extended protocol
(Tatsuo Ishii)
This problem could occur when insert lock is enabled and
pgpool_catalog.insert_lock exists, See [pgpool-general: 1684] for more
details.
[pgpool-general: 1684] insert_lock hangs
http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001711.html
- Fix unnecessary degeneration caused by error on commit (Tatsuo Ishii)
In master slave mode, if master gets an error at commit, while other
slaves are normal at commit, we don't need to degenerate any backend
because it is likely that the "kind mismatch error" was caused by a
deferred trigger.
- Fix to register pgpool_regclass in pg_catalog schema (Tatsuo Ishii)
This is necessary to deal with clients which restricts schema search path
to pg_catalog only. Postgres_fdw is such a client.
- Fix a potential crash in pg_md5 command (Muhammad Usama)
- Fix a segmentation fault of a child process that occurs when a startup
packet has no PostgreSQL user information (Yugo Nagata)
You can reproduce it by
$ psql -p 9999 -U ''
If enable_pool_hba is on, a child process terminates by segmentation
fault. Otherwise if enable_pool_hba is off, the error message is
ERROR: pool_discard_cp: cannot get connection pool for user (null)
database (null)
In both cases, psql terminates with no message on frontend.
In the fixed version, if PostgreSQL user is not specified in startup packet,
the message as following is output to both log and frontend. This is
the same behavior as PostgreSQL.
FATAL: no PostgreSQL user name specified in startup packet
- Move ssl_ca_cert and ssl_ca_cert_dir descriptions to the SSL section
(Yugo Nagata)
- Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document
(Yugo Nagata)
- Fix to verify the backend node number in pcp_recovery_node (Yugo Nagata)
When an invalid number is used, null value is passed as an arguments
of recovery script, and this causes a malfunction. In especially,
rsync may delete unrelated files in basebackup scripts.
===============================================================================
3.1.7 (hatsuiboshi) 2013/4/26
* Version 3.1.7
This is a bugfix release against pgpool-II 3.1.6
__________________________________________________________________
* Bug fixes
- Fix to show pool_passwd in "SHOW pool_status". (Yugo Nagata)
- Fix long standing bug with timestamp rewriting code for processing
extended protocol. (Tatsuo Ishii)
Parse() allocate memory using palloc() while rewriting the parse
message. Problem is, the rewritten message was kept in the data which
is managed by pool_create_sent_message() etc. The function assumes
that all the data is in session context memory. However, palloc()
allocates memory in query context of course, and gets freed later on
when the query context disappears. And the function tries to free the
memory as well, which causes various problems, including segfault and
double free. To fix this, memory to store rewritten message is
allocated using session context. The bug was there since pgpool-II 3.0
was born.
Problem analysis and patch contributed by Naoya Anzai.
[pgpoolgenera-jp: 1146]. (in Japanese)
http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001145.html
- Fix bug with md5 auth long user name handling. (Tatsuo Ishii)
If user name is longer than 32 bytes, md5 authentication doesn't work.
Problem reported in [pgpool-general: 1526] by Thomas Martin.
[pgpool-general: 1526]
[pgPool-II 3.2.3] MD5 authentication and username longer than 32 characters.
http://www.pgpool.net/pipermail/pgpool-general/2013-March/001551.html
- Fix to calculate replication delay only if standby server is behind from
the primary server. (Yugo Nagata)
When the primary server is behind from standby server, negative value of
delay is calculated and the value is assigned to unsigned variable. It
causes a log message informing negative replication delay. And what is
worse, it also causes SELECT queries to be sent to the primary in load
balance even though there are no replication delay in fact.
The problem is reported and analyzed by Saitoh Hidenori in
[pgpool-genera-jp: 1145].
[pgpool-general-jp: 1145] (in Japanese)
http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001144.html
- pgpool-recovery adopts PostgreSQL 9.3. (Tatsuo Ishii)
Patch contributed by Asif Rehman. Slight editing by Tatsuo Ishii.
[pgpool-hackers: 180]
compile error in ppool-recovery
http://www.pgpool.net/pipermail/pgpool-hackers/2013-April/000179.html
- Fix pool_has_pgpool_regclass() to check execute privilege of
pgpool_regclass(). (Tatsuo Ishii)
Even though pgpool_regclass() exists, if pgpool cannot execute the
function, the connection to backend hangs. You can reproduce the problem
by just dropping the execute privilege from pgpool_regclass and do some
insert in native replication mode.
The problem is reported in bugtrack #53.
#53 pgpool_regclass hangs all connections
Date: 2013-04-04 13:35
Reporter: tmandke
http://www.pgpool.net/mantisbt/view.php?id=53
- Fix error message mistakes in detect_postmaster_down_error(). (Tatsuo Ishii)
For example, "LOG: detect_stop_postmaster_error: detect_error error" is
fixed to "LOG: detect_postmaster_down_error: detect_error error", and so on.
===============================================================================
3.1.6 (hatsuiboshi) 2013/2/8
* Version 3.1.6
This is a bugfix release against pgpool-II 3.1.5
__________________________________________________________________
* Bug fixes
- Fix race condition when using md5 authentication. (Tatsuo Ishii)
The file descriptor to pool_passwd is opened in pgpool main and pgpool
child inherits it. When concurrent connections try to authenticate md5
method, they call pool_get_passwd and seek the fd and cause random md5
auth failure because underlying fd is shared. Fix is, let individual
pgpool child open the file by calling pool_reopen_passwd_file.
Problem reported and analyzed by Jason Slagle in pgpool-general:1141.
[pgpool-general: 1141] Possible race condition in pool_get_passwd
From: Jason Slagle
Date: Sun, 28 Oct 2012 01:12:52 -0400
http://www.sraoss.jp/pipermail/pgpool-general/2012-October/001160.html
- Fix hung up while repeating pcp_attach_node and pcp_detach_node
(Tatsuo Ishii)
When node status is changed by pcp_attach_node and pcp_detach_node,
failover() sends SIGUSR1 to pcp_child process expecting it exits to
refresh node status. In this situation lots of pgpool children exit and
produce SIGCHLD as well. The SIGCHLD handler reaper() tries catch all
SIGCHLD but sometimes it fails depending on the system load and timing.
If SIGCHLD produced by pcp child is not caught, the process becomes
zombie and never restarted.
This problem is reported in bug track #32 (by oleg_myrk) etc.
#32 PGPool hangs on pcp_attach/detach
Reporter: oleg_myrk
$B!!(BDate: 2012-10-24 00:01
http://www.pgpool.net/mantisbt/view.php?id=32
- Fix pool_send_severity_message() not to use uninitialized memory.
(Tatsuo Ishii)
It cause a segmentation fault.
Reported in Bug #33's attached valgrind output by dudee.
#33 pgpool-II 3.2.1 segfault
Reporter: dudee
Date: 2012-10-30 19:16
http://www.pgpool.net/mantisbt/view.php?id=33
- Add a description about "-f" to help message. (Tatsuo Ishii)
- Fix reaper() not to exit wait3() loop when catches pcp or worker child
exit event. (Tatsuo Ishii)
Otherwise reaper() mistakenly ignore some process exit event and make a
risk of creating zombie process and forgetting to create new process.
Problem reported and fix suggested by Goto in [pgpool-general-jp: 1123].
http://www.sraoss.jp/pipermail/pgpool-general-jp/2012-November/001122.html
(in Japanese)
- Fix pool_search_relcache() to use MASTER or MASTER_NODE_ID macro, rather
than REAL_MASTER_NODE_ID. (Tatsuo Ishii)
In case node 0 fail back in streaming replication mode, pgpool does not
restart child process. So REAL_MASTER_NODE_ID looks for node 0 con info,
which is not present until new connection to backend made. Thus referring
to node con info results in segfault. MASTER or MASTER_NODE_ID are safe in
this situation because they look at cached former master node id.
- Fix long standing bug "portal not found" error when replication delay
is too much in streaming replication mode. (Tatsuo Ishii)
The bug had been there since the delay threshold was introduced.
We changed destination DB node if delay threshold exceeds in bind,
describe and execute. However, if parse sends to different node, bind,
describe or execute will fail because no parsed statement or portal
exists. Solution is, not to send to different parse node even
if delay threshold is too much.
- Fix pg_md5 to output "\n" after user inputs password. (Yugo Nagata)
- Fix child_exit() to not call send_frontend_exits() if there's no
connection pool. (Tatsuo Ishii)
Otherwise, it segfaults because send_frontend_exits() refers to objects
pointed to by pool_connection_pool. Per bug track #44 by tuomas.
#44 pgpool went haywire after slave shutdown triggering master failover
Reporter: tuomas
Date: 2012-12-11 00:33
http://www.pgpool.net/mantisbt/view.php?id=4
- Fix read_startup_packet() to reset alarm and free StartupPacket when
pool_read() returns 0 which means incorrect packet length. (Nozomi Anzai)
Previously, authentication timeout occurs when connected by a program
monitoring the pgpool port.It is reported in bug track #35 by tuomas.
#35 Authentication is timeout
Reporter: tuomas
Date: 2012-11-20 11:54
http://www.pgpool.net/mantisbt/view.php?id=3
- Fix long standing bug with pool_open(). (Tatsuo Ishii)
It initializes wrong buffer pointer. Actually this is harmless because the
pointer is initialized by prior memset() call, though.
- Modify documents to correct information of whether a certain parameter
change requires restart. (Yugo Nagata)
- Add pool_passwd option to pgpool.conf.sample*, and documents. (Yugo Nagata)
===============================================================================
3.1.5 (hatsuiboshi) 2012/10/12
* Version 3.1.5
This is a bugfix release against pgpool-II 3.1.4
__________________________________________________________________
* Bug fixes
- Fix read_startup_packet. (Tatsuo Ishii)
If packet length is lower than 0, it should
have returned immediately. Otherwise it would cause memory allocation
error later on. per pgpool-general:886.
Also add canceling alarm.
- Add NOTICE message handling to s_do_auth. (Tatsuo Ishii)
Without this, health check responses false alarm and causes failover.
per bug track:
http://www.pgpool.net/mantisbt/view.php?id=25
Also allow to receive ready for query packet *not* right after backend
keydata. I'm not sure if this could happen in the real world but the
protocol seems to allow this.
- Remove unnecessary/confusing debug log from s_do_auth.(Tatsuo Ishii)
- Fix infinite loop in SSL mode. When there's pending data in SSL layer
of frontend, pool_process_query() checks pending data in backend.
(Tatsuo Ishii)
If there's non, it loops again and checks frontend/backend receive buffer
by using is_cache_empty(). Unfortunately it first checks pending data
in SSL layer of frontend, thus goes to backend data and checks again
(infinite loop).
The solution is, if there's pending data in SSL layer of frontend and
query is not in progress, call ProcessFrontendResponse() to process new
request from frontend.
- Fix is_system_catalog to use pgpool_regclass if available.
(Tatsuo Ishii)
- Fix memory leak in pool_get_insert_table_name(). (Tatsuo Ishii)
If session context's memory contex is used for nodeToString(), memory is
not freed until session ends.
- Fix possible memory leak in nodeToString(). (Tatsuo Ishii)
Since the memory context could be session context, memory used for
String object may be considerable if user session continues for hours or
days.
See bug track #24 for more details.
- Fix long standing problem with do_query(). (Tatsuo Ishii)
When 1) extended protocol used and 2)unnamed portal is used and 3) no
explicit transaction is used, user's unnamed portal is removed by Sync
message.
This is because Sync message closes transaction and unnamed portal is
removed. This leads to "portal "" does not exist" error.
Fix is, use "Flush" message instead of Sync. Main difference between
using Sync and Flush is, Flush does not return Ready for Query message.
So do_query() does not return until all expected responses are returned.
It seems the order of messages returned from backend is random, and
do_query () manages it by using state bits.
===============================================================================
3.1.4 (hatsuiboshi) 2012/08/06
* Version 3.1.4
This is a bugfix release against pgpool-II 3.1.3.
__________________________________________________________________
* General
- Adopt PostgreSQL 9.2. (Tatsuo Ishii)
__________________________________________________________________
* Bug fixes
- Fix pool_send_and_wait() to send or not to send COMMIT / ABORT
depending on the transaction state on each node. (Tatsuo Ishii)
It is possible that only primary is in an explicit transaction but
standby is not in it if multi statement query has been sent.
Per bug report [pgpool-general-jp: 1049].
- Fix load balance in Solaris. (Tatsuo Ishii)
Problem is, random() in using random() in Solaris results in strange
load balancing calculation.
Use srand()/rand() instead although they produce lesser quality random
Problem reported at [pgpool-general: 396].
[pgpool-general: 396] strange load balancing issue in Solaris
http://www.pgpool.net/pipermail/pgpool-general/2012-April/000397.html
- Add params to the result of "SHOW pool_status": backend_data_directory,
ssl_ca_cert, ssl_ca_cert_dir. (Nozomi Anzai)
- Fix segfault of pcp_systemdb_info not in parallel mode. (Nozomi Anzai)
- Fix "unnamed prepared statement does not exist" error. (Tatsuo Ishii)
This is caused by pgpool's internal query, which breaks client's
unnamed statements. To fix this, if extended query is used, named
statement/portal for internal are used for internal query.
- Fix is_system_catalog(). Its relcache was accidently defined as
"session local". (Tatsuo Ishii)
- Fix hangup when query conflict occurs in Hot-Standby mode.
(Yugo Nagata)
Query example to reproduce:
(S1) BEGIN;
(S1) SELECT * FROM t;
(S2) DELETE FROM t;
(S2) VACUUM t;
- Improve reading and writing pid_file. (Tatsuo Ishii)
- Fix pool_process_query() bug reported in [pgpool-general: 672].
(Tatsuo Ishii)
This is caused by the function waits for primary node which does not
have pending data, while standbys have pending data.
[pgpool-general: 672] Transaction never finishes
http://www.pgpool.net/pipermail/pgpool-general/2012-June/000676.html
- Fix wait_for_query_response() not to send param status to frontend if
frontend is NULL. (Tatsuo Ishii)
This could happen while processing reset_query_list and occur crash.
- Fix bug with treatment of BEGIN TRANSACTION in master/slave mode.
(Tatsuo Ishii)
Original complain is [pgpool-general: 714].
From 3.1, pgpool-II sends BEGIN.. to all DB nodes. Of course we cannot
send BEGIN TRANSACTION READ WRITE to standby nodes.
Problem is, we did not check BEGIN WORK ISOLATION LEVEL SERIALIZABLE;
and sent to standby nodes. Of course this is wrong, since it's not
allowed to run transactions in serializable mode on standby nodes.
So added check for BEGIN WORK ISOLATION LEVEL SERIALIZABLE case.
[pgpool-general: 714]
Load Balancing / Streaming Replication / Isolation Level serializable
http://www.pgpool.net/pipermail/pgpool-general/2012-July/000719.html
- Fix send_to_where() to send the query to only primary if the it is like
SET TRANSACTION ISOLATION LEVELSERIALIZABLE etc. (Tatsuo Ishii)
Case in streaming replication mode. Previously, it was sent to not only
primary but also to standby and of course this causes an error.
Similar SQLs are:
SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL
SERIALIZABLE or SET transaction_isolation TO 'serializable'
SET default_transaction_isolation TO 'serializable'
Original complain is [pgpool-general: 715].
[pgpool-general: 715]
Re: Load Balancing / Streaming Replication / Isolation Level
serializable
http://www.pgpool.net/pipermail/pgpool-general/2012-July/000720.html
===============================================================================
3.1.3 (hatsuiboshi) 2012/04/23
* Version 3.1.3
This is a bugfix release against pgpool-II 3.1.2.
__________________________________________________________________
* Bug fixes
- Add m4 files. This should prevent compiling problem on older
OS's. (Tatsuo Ishii)
- Fix to handle failover properly in detect_postmaster_down_error().
(Tatsuo Ishii)
It is possible that it fails to read backend socket after detecting
backend errors and before actually detaching the backend.
- Fix bug that the process exits before unlocking semaphore by a
signal interrupt. (Tatsuo Ishii)
- Fix a memory leak in case of reset_query. (Tatsuo Ishii)
- Fix pool_ssl_read() to deal with large data reading. (Tatsuo Ishii)
Original complain is here:
http://www.pgpool.net/pipermail/pgpool-general/2012-March/000299.html
- Fix deadlock by enabling log_destination = syslog. (Tatsuo Ishii)
Reported in bug tracker http://www.pgpool.net/mantisbt/view.php?id=9.
Patch provided by Gilles Darold.
- Allow to use multi statement in master/slave mode. (Tatsuo Ishii)
From 3.1 transactional statements such as "BEGIN" are sent to not only
primary but also standbys. This brings an unfortunate side effect: if
the multi statement is "BEGIN;DELETE FROM table;END", this will be
sent to standby as well and cause an error because standby does notallow
write SQL. So fix is, if a query is a multi statement one, then send it
to primary only.
- Allow to have private cache of master node id. (Tatsuo Ishii)
When master goes down running pgpool children look into NULL pointer
because the process does not connect to the new master yet. The private
cache returns the old master node id and will avoid the situation.
Per bug reported in http://www.pgpool.net/mantisbt/view.php?id=51
- Fix pool_start_query() so that it uses my_master_node_id instead of
REAL_MASTER_NODE_ID for initial virtual_master_node_id. (Tatsuo Ishii)
Real master node could be changed while pgpool is running in streaming
replication mode. Previously it is assigned REAL_MASTER_NODE_ID, which
could have no connections after fail over and cause segfault.
- Fix pool_setall_node_to_be_sent() to use private_backend_status instead
of BACKEND_INFO macro. (Tatsuo Ishii)
It is possible that while processing, the node returned by BACKEND_INFO
is not usable any more.
- Fix failover(). (Tatsuo Ishii)
Before it only restarts worker child only when pgpool child do not need
restart. This is wrong. We need to restart worker child in any case.
Otherwise it continues to send replication time lag check request to down
the node.
- Fix debug log message so that it does not contain null characters.
(Toshihiro Kitagawa)
- Fix SimpleQuery() so that it restores parser memory context when:
1) Builtin show commands are used
2) Parallel query mode
3) Query cache is used
(Tatsuo Ishii)
- Fix hangup when PREPARE statement causes error. (Toshihiro Kitagawa)
This issue was reported by Tomonari Katsumata:
Subject: [pgpool-general: 121] question of pgpool's behavior
- Add doc/pgpool-fr.html to Makefile.am. (Tatsuo Ishii)
This had been forgotten when the doc was added.
- Fix hangup during md5 authentication that occurs in daemon mode
and log_destination is 'syslog'. (Yugo Nagata)
Reported in bug tracker http://www.pgpool.net/mantisbt/view.php?id=2.
===============================================================================
3.1.2 (hatsuiboshi) 2012/01/31
* Version 3.1.2
This is a bugfix release against pgpool-II 3.1.1.
__________________________________________________________________
* Bug fixes
- Fix to recognize READ UNCOMMITTED and REPEATABLE READ of transaction
isolation levels. (Tatsuo Ishii)
- Fix infinite loop reported in this thread (Tatsuo Ishii):
http://www.pgpool.net/pipermail/pgpool-general/2011-December/000099.html
It was not considered the case that, when received buffer in primary was
empty but the one in a standby was not, the standby spontaneously sent
packet to pgpool.
This could happen when, for example, reloading postgresql.conf.
The fix is that such buffer in standby is discarded.
===============================================================================
3.1.1 (hatsuiboshi) 2011/12/06
* Version 3.1.1
This is a bugfix release against pgpool-II 3.1.
__________________________________________________________________
* Bug fixes
- Fix add_regex_pattern(). It does not allocate enough memory
for each black/white_function_list items. The function adds
"^" and "$" to each function items which do not contain those
characters. Unfortunately the function forgot to add extra 2
bytes for those characters. This may lead to memory corruption
errors when pgpool starting up.
- Fix error message of check_replication_time_lag(Tatsuo
Ishii). It emitted wrong error message when it failed to
connect to PostgreSQL while checking streaming replication
delay. Because it does not use health_check_user anymore.
- Fix memory leak(Toshihiro Kitagawa). This is essentially same
as the fix made for 3.0.5(commit
19a4ea9215da0b61728741fc0da2271958b09238).
- Major cleanup for strncpy(Tatsuo Ishii). There are several
places where strncpy() is used. Problem is some of them do not
consider the case when copy length == buffer size. In this case
copied buffer is not null terminated and may cause tons of
problems later. To fix this, most of them are replaced by
strlcpy().
- Update cached backend status whenever possible(Tatsuo Ishii).
This solves the problem of follow_master_command not being
able to lookup backend status correctly which was reported by
Jeff Frost: Subject: [Pgpool-general] diagnosing BackendError
from pcp_recovery_node To: pgpool-general@pgfoundry.org Date:
Wed, 05 Oct 2011 15:15:07 -0700
- Fix buffer overrun problem when pcp password is longer than
32(Tatsuo Ishii).
- Remove PGDLLIMPORTI which is only necessary for Windows
and cause a problem for non gcc. Patch contributed by Ibrar Ahmed.
===============================================================================
3.1 (hatsuiboshi) 2011/09/08
* Version 3.1
This is the first version of pgpool-II 3.1 series.
That is, a "major version up" from 3.0 series.
__________________________________________________________________
* Incompatible changes
- Change the lock method of insert_lock. The previous insert_lock uses
row locking against the sequence relation, but the current one uses
row locking against pgpool_catalog.insert_lock table. The reason is
that PostgreSQL core developers decided to disallow row locking
against the sequence relation to avoid an internal error which it
leads. So creating insert_lock table in all databases which are
accessed via pgpool-II beforehand is required. If does not exist
insert_lock table, pgpool-II locks the insert target table. This
behavior is same as pgpool-II 2.2 and 2.3 series. If you want to use
insert_lock which is compatible with older releases, you can specify
lock method by configure options: --enable-sequence-lock,
--enable-table-lock(Toshihiro Kitagawa)
- Deprecate backend_socket_dir. Instead, if backend_hostname starts
with '/' it is regarded the as path to Unix domain. If backend_hostname
is left empty, then default Unix domain path(/tmp) is used. This
follows the convention of libpq interface. Patch contributed by
Jehan-Guillaume (ioguix) de Rorthais.
- Now "pgpool_walrecrunning()" was not used. pgpool-II used to consider
the node that is promoted a primary node using the function. Now,
pgpool-II waits for completing of the promotion to primary node
because it did not work as we intended. But we still have a problem
that pgpool-II waits while recovery_timeout, when there is no primary
node(Toshihiro Kitagawa)
- Add node_id to each PostgreSQL DB node info in the output of
show pool_nodes(Jean-Paul Argudo)
- Change the handling of sequence functions(nextval, setval) so that
they completely obey setting of black/white_function_list. They were
always handled as write functions before(Toshihiro Kitagawa)
__________________________________________________________________
* New features
- Add syslog support. Patch contributed by Gilles Darold. Review and
editing by Guillaume Lelarge.
- Adapt application_name introduced in PostgreSQL 9.0. When reusing
connection, send application_name in the startup packet to backend
and send parameter status to frontend(Tatsuo Ishii)
- Add relcache_expire directive to control the expiration of the
internal system catalog cache. ALTER TABLE might make these
cache values obsoleted and the new directive will make the risk
lower(Tatsuo Ishii).
- Add follow_master_command directive. This directive specifies a
command to run in master/slave streaming replication only after
a master failover. Patch contributed by Gilles Darold.
- Add pcp_promote_node command. This command promotes a new master
node to pgpool-II. This can use in master/slave streaming replication
only. Patch contributed by Gilles Darold.
- Add pcp_pool_status command which produces similar output of show
pool_status. Also C API for this command is added. Patch
contributed by Jehan-Guillaume (ioguix) de Rorthais.
- Add new per backend directive "backend_flag". This controls per
backend behavior. Currently "ALLOW_TO_FAILOVER" or
"DISALLOW_TO_FAILOVER" are allowed(Tatsuo Ishii)
- Add health_check_password directive, but is not yet implemented
(Nicolas Thauvin)
- Add sr_check_period, sr_check_user and sr_check_password directives.
These are used for streaming replication delay checking and
determining primary node(Tatsuo Ishii)
- Add --username(or -u) option to pg_md5 command. This allows to manage
users which do not have UNIX accounts. Japanese document change by
Tatsuo Ishii(Nicolas Thauvin)
- Add pgpool_adm functions to pgpool_adm/. These are user-defined
functions written in C language which work like pcp commands
(Jehan-Guillaume (ioguix) de Rorthais)
- Add Simplified Chinese version of documents(Huang Jian, Sun Peng)
- Add SQL files to uninstall functions to sql/(Nicolas Thauvin)
- In master/slave mode, SELECTs to unlogged table execute only on
master/primary(Toshihiro Kitagawa)
__________________________________________________________________
* Bug fixes
- Fix bug which cannot use the cursors of JDBC driver on standby
node. The transaction commands come to be sent to all nodes by
this fix in master/slave mode(Toshihiro Kitagawa)
- Fix bug with the handling of empty queries. The empty queries
come to be handled the same as SELECT queries. This fix allows
load-balance after the empty query(Toshihiro Kitagawa)
- Fix insert_lock so that it works correctly even if the column
definition such as "DEFAULT nextval(('"x_seq"'::text)::regclass)"
(Toshihiro Kitagawa)
- Fix pcp_attach_node command so that it emits error message while
doing failover(Toshihiro Kitagawa)
- Fix log message which is emitted when pgpool-II cannot parse the
query in the extended query protocol so that it shows the query
(Toshihiro Kitagawa)
- Fix description about backend_weight inpgpool-II manual. It can
be changed by reloading pgpool.conf(Tatsuo Ishii)
- Fix and enhance wording in English tutorial document.
Fix suggested by Huang Jian(Tatsuo Ishii)
- Fix bug which does not update the node status when reattaching the
node in raw mode(Guillaume Lelarge)
- Fix incorrect calculation of the replication delay in streaming
replication mode(Tatsuo Ishii)
- Replace wrong function name "notice_backend_error" with correct one
"degenerate_backend_set" in the failover log message(Tatsuo Ishii)
- Remove unnecessary logging at the end of pgpool.conf parsing(Tatsuo Ishii)
- Fix possible crash of pgpool/worker child after attaching new backend.
Fix suggested by Gurjeet Singh(Tatsuo Ishii)
- Fix bug that SELECTs which have subquery with FOR SHARE/UPDATE clause
are sent to slave/standby(Tatsuo Ishii)
- Fix bug which rewriting timestamp of default value fails in PREPARE
statements. This used to work but was broken in 3.0(Toshihiro Kitagawa)
- Fix fail to compile pcp commands on the environment without
getopt_long()(Tatsuo Ishii)
- Fix crash of pgpool child when frontend connects if in raw mode,
enable_hba is off and more than 2 backends(Toshihiro Kitagawa)
- Fix some memory leaks(Toshihiro Kitagawa)
__________________________________________________________________
* Enhancements
- Enhance online recovery in streaming replication mode.
Now restarting pgpool-II children is avoided when recovery finished. So
existing sessions can be continued while doing online recovery(Tatsuo Ishii)
- pcp_attach_node does not disconnect existing sessions in
streaming replication mode. In other mode, pcp_attach_node
still disconnects existing sessions(Tatsuo Ishii).
- Import PostgreSQL 9.0 parser. This allows to use CREATE INDEX with
implicit index name, which is new in 9.0. Patch contributed by
Akio Ishida.
- Allow to use regular expressions in black and white function list.
Patch contributed by Gilles Darold. Patch reviewed by Guillaume Lelarge.
- Reorganize pgpool.conf sample files so that they are easier to read
(Guillaume Lelarge)
- Add <a name="..."> tags into all parameters in the pgpool-II user
manual(Haruka Takatsuka)
- Enhance online recovery documents in streaming replication(Tatsuo Ishii)
- Change the function to check the replication delay in streaming
replication mode. Currently, pgpool uses
pg_last_xlog_replay_location() instead of
pg_last_xlog_receive_location(). Fix suggested by Anton Yuzhaninov
(Tatsuo Ishii)
- Allow time stamp rewriting to work with arbitrary expression in
default value of a column. Before we detected anything including
now() then simply replaced it to now(). This will lead to wrong
rewriting of default value. for example, timezone('utc'::text, now()).
Note that, however, this only adopts to simple queries. Extended
protocols(for example Java, PHP PDO) or SQL "PREPARE" still remain
same(Tatsuo Ishii)
- Enhance the error message which is emitted when failed to check
replication delay(Nicolas Thauvin)
- Change error message "do_md5: read_password_packet failed" into debug
level(Toshihiro Kitagawa)
- Allow to compile pgpool-regclass() against PostgreSQL 9.1(Tatsuo Ishii)
- Update and sync pgpool-II manuals of English version and Japanese
version(Tatsuo Ishii)
===============================================================================
3.0 Series (2013/07/30 - )
===============================================================================
3.0.20 (umiyameboshi) 2016/02/05
* Version 3.0.20
This is a bugfix release against pgpool-II 3.0.19.
This is the final release of the series. pgpool-II 3.0 has reached
End of Life, and is no longer maintained and does not receive any
updates.
__________________________________________________________________
* Bug fixes
- doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii)
In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent
to primary node only. Pointed out in [pgpool-general-jp: 1378].
- Issue fsync() when writing pgpool_status (Tatsuo Ishii)
This ensures that pgpool_status is saved to permanent storage and
allow to survive after system crash.
- doc: Fix wrong description about log_standby_delay in the document
(Yugo Nagata)
- Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii)
Pgpool-II remembers that non read only queries (including SET) were
executed in an explicit transaction and adds a "writing transaction"
mark to the transaction. The mark affects the query routing behavior
of pgpool-II while running in streaming replication mode. Pgpool-II
starts sending queries to the primary after the mark is set. Because
the effect of writing queries may appear on standbys after some delay
in streaming replication mode, it is safer to route read queries to
the primary after the mark is set.
However there's oversight here. "SET TRANSACTION READ ONLY" does no
data modification and should be treated as an exception.
Per bug #157.
- Fix FATAL error with reloading (Tatsuo Ishii)
While reloading pgpool.conf, the number of DB nodes is tentatively set
to 0, then counted up until reaching to the actual number of backends
by the pgpool main process. Unfortunately the variable was on the
shared memory and it confused pgpool child process when they were using
the variable and this caused FATAL error.
Per bug #156 report by harukat.
- Ignore close statement/portal request if they do not exist (Tatsuo Ishii)
In this case just returns a close complete message to client.
This is a back port of the following commit from pgpool-II 3.4:
1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0
===============================================================================
3.0.19 (umiyameboshi) 2015/07/24
* Version 3.0.19
This is a bugfix release against pgpool-II 3.0.18.
__________________________________________________________________
* Bug fixes
- Fix "cannot find xlog functions" error in pgpool-recovery
(Muhammad Usama)
The argument data type of PostgreSQL's pg_xlogfile_name() function
has been changed from text to pg_lsn since PostgreSQL 9.4. And
pgpool-recovery was still trying to locate the function by old
signature.
- Do not send a query for checking insert lock in non replication mode
with extended query (Tatsuo Ishii)
===============================================================================
3.0.18 (umiyameboshi) 2015/04/08
* Version 3.0.18
This is a bugfix release against pgpool-II 3.0.17.
__________________________________________________________________
* Bug fixes
- Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii)
This is used in show pool_status command and limits the length of
parameter description. Unfortunately recovery_timeout description is
64 chars, which is 1 byte longer than former definition of the macro.
- Support SSL certificate chains in the certificate file for incoming
frontend connections (Muhammad Usama)
- Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama)
When graceful node detach is requested gracefully, pcp_detach_node should
check if it is allowed to process detach_node command on the particular
node before blocking the incoming connections and closing the existing
connections.
===============================================================================
3.0.17 (umiyameboshi) 2015/02/05
* Version 3.0.17
This is a bugfix release against pgpool-II 3.0.16.
__________________________________________________________________
* Bug fixes
- doc: Describe explicitly that the number of slave nodes is not
necessarily 1 (Tatsuo Ishii)
- Fix uninitialized variable (Tatsuo Ishii)
Per Coverity 1234603.
- doc: Fix missing release note entries in the previous release
(Tatsuo Ishii)
- Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii)
The node id should be lower than NUM_BACKENDS. Probably harmless since
callers never pass node ids greater or equal to NUM_BACKENDS.
- Fix to disable debug mode by reloading config (Yugo Nagata)
Per bug #114
http://www.pgpool.net/mantisbt/view.php?id=114
===============================================================================
3.0.16 (umiyameboshi) 2014/09/05
* Version 3.0.16
This is a bugfix release against pgpool-II 3.0.15.
__________________________________________________________________
* Bug fixes
- Fix a typo of pgpool.spec (Yugo Nagata)
- Fix bug that worker child process keeps failing when there's no
primary backend (Tatsuo Ishii)
Problem identified and fix contributed by Junegunn Choi.
See [pgpool-hackers: 471] for more details.
- Close listen socket when smart shutdown request is made (Tatsuo Ishii)
When smart shutdown process starts, pgpool children still listen on
the port and clients can send further connection requests which fail
in the end. Which is not only waste of time, but also prevents a load
balancer which sits in front of pgpool from realizing the pgpool is
going down.
Problem analyzed and patch provided by Junegunn Choi in [pgpool-hackers
474], and enhanced to take care not only inet domain socket but UNIX
domain socket by Tatsuo Ishii.
- doc: Add cautions that recovery commands are killed by statement_timeout
of PostgreSQL. (Tatsuo Ishii)
- doc: Remove old restriction description which is no longer true
(Tatsuo Ishii)
- Fix return type of text_to_lsn() function (Yugo Nagata)
This caused compile warning.
- Fix file descriptor leak when daemonize. (Tatsuo Ishii)
Per Coverity 1111471.
- Fix memory leak. (Tatsuo Ishii)
Per Coverity 1111442.
- Fix pgpool.init's long-standing bug of stop/restart failure
(Yugo Nagata)
In previous, pgpool.init uses killproc for stopping pgpool, but there
are several problems. In the new version, "pgpool -m fast stop" is
used in stop command.
Original patch contributed by Ryan DeShone and modified by Yugo Nagata.
See [pgpool-hackers: 239][pgpool-hackers: 512].
- Disable statement_timeout of PostgreSQL while executing online recovery
(Tatsuo Ishii)
Online recovery may take very long time and user may enable statement
timeout. To prevent online recovery canceled by statement timeout,
disable statement timeout in the connection used by online recovery.
See [pgpool-general: 2919] for more details.
- Remove unnecessary call to pool_shmem_exit() which removes semaphore
when it shouldn't (Tatsuo Ishii)
exit_handler checks if the process is parent or not. This is
good. However, even if it is a child process, it calls
pool_shmem_exit() which removes semaphore and shmem when it should
not. It should be called only from parent process.
Per bug #102.
http://www.pgpool.net/mantisbt/view.php?id=102
===============================================================================
3.0.15 (umiyameboshi) 2014/03/24
* Version 3.0.15
This is a bugfix release against pgpool-II 3.0.14.
__________________________________________________________________
* Bug fixes
- doc: Add mention about "listen queue" and how to increase the "backlog"
in the num_init_children section. (Tatsuo Ishii)
- Fix bad performance of unlogged tables detection code. (Tatsuo Ishii)
Pointed out at [pgpool-hackers: 435][[pgpool-general:2325].
- Fix primary node detection logic. (Tatsuo Ishii)
There's a possibility that primary node is not detected. This happens
in following situation. node 0: primary, node 1: standby. Node 0 goes
down. Health checking detects the fact but local status is not updated
yet. Primary node finding (find_primary_node) runs. Node 0's status is
yet healthy. Because find_primary_node fails to connect to node 0, it
immediately returns -1 and fails to find that fact that node 1 is now
primary.
Fix is just continuing to look for primary node when fails to connect
to a node.
Per [pgpool-general: 2409].
- Fix jdbc DML fails when operated in raw mode and auto commit is off.
(Tatsuo Ishii)
This is reported in bug #92.
- Avoid to send queries to unrelated nodes in streaming replication mode.
(Tatsuo Ishii)
Pgpool-II sends certain queries, such as BEGIN, END and SET commands to
all of DB nodes. However in streaming replication mode, only primary
node and at most one standby node are only concerned (if primacy node
is selected as the load balance node, only 1 node is concerned).
See [pgpool-hackers: 464] for more details.
- Fix possible buffer overrun problem and memory leak. (Tatsuo Ishii)
Per Coverity 1111465 and 1111482.
- Fix freeing NULL. (Tatsuo Ishii)
Per Coverity 1111384.
- Fix memory leak. (Tatsuo Ishii)
Per Coverity 1111446.
- Fix a segmentation fault in parallel mode with system_db_hostname is
empty (Yugo Nagata)
- Fix to output debug messages in processing pgpool.conf with -d option
(Yugo Nagata)
Previously, some debug messages in pool_get_config() ware not output
even when -d option was used.
- Fix JDBC exception of prepared statement including now() in
replication mode (Yugo Nagata)
With JDBC, when a prepared statement is executed more than
PrepareThreshold times, the statement is named and Describe message
is sent after Parse. With named statement, pgpool rewrite now() to
parameter in replication mode. Hence, rewritten query has additional
parameter than original. In this case, ParameterDescription message
sent to frontend (response of Describe) should include OIDs of the
same number os original query's parameters. Otherwize, JDBC throws
ArrayIndexoutOfBoundsException.
This is reported in [pgpool-general-jp: 1192].
- Fix backend error of prepared statement about table which has column whose
default value is now() in replication mode (Yugo Nagata)
When pgpool parses a named prepared statement with default now(),
timestamps are replaced to additional parameters. So, Bind message also
should included additional parameter format codes. However, when the
number of original parameter was one, pgpool didn't handle this. This
caused a error like "incorrect binary data format in bind parameter 2".
- doc: Add description about parallel mode doesn't support PREPARE (Yugo Nagata)
Per bug #93
===============================================================================
3.0.14 (umiyameboshi) 2013/12/06
* Version 3.0.14
This is a bugfix release against pgpool-II 3.0.13.
__________________________________________________________________
* Bug fixes
- Fix incorrect time stamp rewriting in replication mode for certain time
zones. (Tatsuo Ishii)
Time stamp rewriting calls "SELECT now()" to get current time.
Unfortunately the buffer for the current time is too small for certain
time zones such as "02:30". Note that non-30-minutes-time-zone such as
"0900" does not reveal the problem. This explains why we haven't the bug
report until today.
Bug reported in [pgpool-general: 2113] and fix provided by Sean Hogan.
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002142.html
- Makefile: Replace pg_config by $(PG_CONFIG) in Makefiles so it can be
overridden at build time when compiling for different PG major versions.
(Tatsuo Ishii)
Patch contributed by Christoph Berg ([pgpool-general: 2127]).
http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html
- configure: Remove -lcompat because it confuses FreeBSD per bug#15.
(Tatsuo Ishii)
http://www.pgpool.net/mantisbt/view.php?id=15
- Fix segfault when pgpool.conf does not set log_standby_delay.
(Tatsuo Ishii)
This is caused by wrong initialization for log_standby_delay in
pool_config.l.
Per bug#74. http://www.pgpool.net/mantisbt/view.php?id=74
- doc: Modify descriptions about restrictions of parallel mode
Multiple rows INSERT using VALUES are not supported in parallel mode.
(Yugo Nagata)
- Avoid calling find_primary_node_repeatedly() when standby node goes
down. (Tatsuo Ishii)
This will reduce the time to failover. Per bug #75, patch modified by
Tatsuo Ishii. http://www.pgpool.net/mantisbt/view.php?id=75
- Fix error message in read_password_packet(). (Tatsuo Ishii)
- Fix memory leak when do_query() fails in timestamp rewriting.
(Tatsuo Ishii)
For this purpose free_select_result() is changed to accept NULL argument.
Per Coverity report "1111454, 1111455 Resource leak".
- Fix target node selection logic when "DEALLOCATE portal|statement".
(Tatsuo Ishii)
When "DEALLOCATE portal|statement" is used and last prepared statement or
portal was not found, target node selection map is not set. Probably this
is not actually harmful because prepared statement or portal was not found
is an error case. The bug was there since day 0.
Per Coverity report "1111491 Structurally dead code".
- Fix range check bug of MAX_NUM_BACKENDS in corner case. (Tatsuo Ishii)
MAX_NUM_BACKENDS is the allowed max number of DB nodes (128, at this
point). In reality, probably no one ever tried more than 128 DB nodes
and that's the reason why nobody noticed.
Per Coverity report "1111429, 1111430 and 1111431 Out-of-bounds write".
- Fix that the script forgets to allow public access to pgpool_catalog.
(Tatsuo Ishii)
The bug prevents inserting data into user tables if pgpool_catalog is
created in native replication mode. The bug was there from day 1. I
wonder why nobody noticed until today.
Per [pgpool-general-jp: 1229].
http://www.sraoss.jp/pipermail/pgpool-general-jp/2013-November/001228.html
- Fix uninitialized variable in error case in pool_do_auth().
(Tatsuo Ishii)
If there's no valid backend, pgpool will return garbage pid to frontend in
auth phase. Actually because no backend is available, frontend will be
disconnected later on. So this is not harmless.
Per Coverity report "1127331 Uninitialized scalar variable".
- Fix to add node id range check when issue an error message using node
id. (Tatsuo Ishii)
Per Coverity report #1111433 "Out-of-bounds read".
- Fix buffer overrun bug and resource leak bug of parse_copy_data().
(Tatsuo Ishii)
Per Coverity report 1111427 "Out-of-bounds write" and 1111453 "Resource
leak".
- Fix possible segfault in CopyDataRaws(). (Tatsuo Ishii)
Coverity pointed out that if pool_get_id() returns an error, VALID_BACKEND
will access out of array.
Per Coverity report 1111413 "Memory - illegal accesses".
- Fix strftime() usage in pool_pools(). (Tatsuo Ishii)
The buffer is not large enough as expected by the second parameter. This
is not harmless because the format string will not produce longer result
string than the buffer.
Per Coverity report 1111426 "Out-of-bounds access".
- Fix resource leak in make_persistent_db_connection. (Tatsuo Ishii)
For this purpose, new static function free_persisten_db_connection_memory
is added.
Per Coverity report #1111468.
===============================================================================
3.0.13 (umiyameboshi) 2013/09/06
* Version 3.0.13
This is a bugfix release against pgpool-II 3.0.12.
__________________________________________________________________
* Bug fixes
- Fix a mistake in ssh command of doc/basebackup.sh (Tatsuo Ishii)
- Fix a bug in parsing prepared statements with transaction handling in
replication mode (Tatsuo Ishii)
Parse() automatically starts a transaction for non SELECT query to keep
consistency among nodes in replication mode. But this wasn't closed. If
wrong query comes in, the transaction goes into an abort state but pgpool
does not close the transaction. Thus next query causes error because the
transaction is still in abort status.
This problem was reported in [pgpool-general: 1877] by Sean Hogan.
[pgpool-general: 1877] current transaction is aborted, commands ignored
http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001905.html
- Fix typos of the japanese document (Yugo Nagata)
===============================================================================
3.0.12 (umiyameboshi) 2013/07/10
* Version 3.0.12
This is a bugfix release against pgpool-II 3.0.11.
__________________________________________________________________
* Bug fixes
- Add mention about "-D" option to the man page. (Tatsuo Ishii)
- Consider timeout waiting for completion of failback request in on line
recovery (Tatsuo Ishii)
This will prevent the situation that recovery operation continues forever
and we cannot even shutdown pgpool-II main process. This could happen
especially while executing follow master command.
- Fix do_query() to not hang when PostgreSQL returns an error
(Tatsuo Ishii)
The typical symptom is "I see SELECT is keep on running according to
pg_stat_activity". To fix this pgpool-II just exits the process and
kill the existing connection. This is not gentle but at this point I
believe this is the best solution.
- Fix bug with do_query which causes hung in extended protocol
(Tatsuo Ishii)
This problem could occur when insert lock is enabled and
pgpool_catalog.insert_lock exists, See [pgpool-general: 1684] for more
details.
[pgpool-general: 1684] insert_lock hangs
http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001711.html
- Fix unnecessary degeneration caused by error on commit (Tatsuo Ishii)
In master slave mode, if master gets an error at commit, while other
slaves are normal at commit, we don't need to degenerate any backend
because it is likely that the "kind mismatch error" was caused by a
deferred trigger.
- Fix to register pgpool_regclass in pg_catalog schema (Tatsuo Ishii)
This is necessary to deal with clients which restricts schema search path
to pg_catalog only. Postgres_fdw is such a client.
- Fix a potential crash in pg_md5 command (Muhammad Usama)
- Fix a segmentation fault of a child process that occurs when a startup
packet has no PostgreSQL user information (Yugo Nagata)
You can reproduce it by
$ psql -p 9999 -U ''
If enable_pool_hba is on, a child process terminates by segmentation
fault. Otherwise if enable_pool_hba is off, the error message is
ERROR: pool_discard_cp: cannot get connection pool for user (null)
database (null)
In both cases, psql terminates with no message on frontend.
In the fixed version, if PostgreSQL user is not specified in startup packet,
the message as following is output to both log and frontend. This is
the same behavior as PostgreSQL.
FATAL: no PostgreSQL user name specified in startup packet
- Move ssl_ca_cert and ssl_ca_cert_dir descriptions to the SSL section
(Yugo Nagata)
- Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document
(Yugo Nagata)
- Fix to verify the backend node number in pcp_recovery_node (Yugo Nagata)
When an invalid number is used, null value is passed as an arguments
of recovery script, and this causes a malfunction. In especially,
rsync may delete unrelated files in basebackup scripts.
- Fix reset query stuck problem. (Tatsuo Ishii)
It is reported that reset query (DISCARD ALL etc.) occasionally does
not finish and pgpool child remain waiting for reply from backend thus
client cannot connect to pgpool.
The cause of problem is not identified yet but if client suddenly
closes connection to pgpool in the middle of query processing, backend
may not accept the reset queries because they are not ready for query.
The fix is, if frontend closes connection in unexpected way, query
process loop immediately returns with new state:
POOL_END_WITH_FRONTEND_ERROR and pgpool closes connection to
PostgreSQL then goes back to new connection request waiting loop.
Also, pgpool closes connections to backend when client_idle_limit is
set and the idle limit.
Per bug #107.
http://www.pgpool.net/mantisbt/view.php?id=107
===============================================================================
3.0.11 (umiyameboshi) 2013/04/26
* Version 3.0.11
This is a bugfix release against pgpool-II 3.0.10.
__________________________________________________________________
* Buf fixes
- Fix to show pool_passwd in "SHOW pool_status". (Yugo Nagata)
- Fix long standing bug with timestamp rewriting code for processing
extended protocol. (Tatsuo Ishii)
Parse() allocate memory using palloc() while rewriting the parse
message. Problem is, the rewritten message was kept in the data which
is managed by pool_create_sent_message() etc. The function assumes
that all the data is in session context memory. However, palloc()
allocates memory in query context of course, and gets freed later on
when the query context disappears. And the function tries to free the
memory as well, which causes various problems, including segfault and
double free. To fix this, memory to store rewritten message is
allocated using session context. The bug was there since pgpool-II 3.0
was born.
Problem analysis and patch contributed by Naoya Anzai.
[pgpoolgenera-jp: 1146]. (in Japanese)
http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001145.html
- Fix bug with md5 auth long user name handling. (Tatsuo Ishii)
If user name is longer than 32 bytes, md5 authentication doesn't work.
Problem reported in [pgpool-general: 1526] by Thomas Martin.
[pgpool-general: 1526]
[pgPool-II 3.2.3] MD5 authentication and username longer than 32 characters.
http://www.pgpool.net/pipermail/pgpool-general/2013-March/001551.html
- Fix to calculate replication delay only if standby server is behind from
the primary server. (Yugo Nagata)
When the primary server is behind from standby server, negative value of
delay is calculated and the value is assigned to unsigned variable. It
causes a log message informing negative replication delay. And what is
worse, it also causes SELECT queries to be sent to the primary in load
balance even though there are no replication delay in fact.
The problem is reported and analyzed by Saitoh Hidenori in
[pgpool-genera-jp: 1145].
[pgpool-general-jp: 1145] (in Japanese)
http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001144.html
- pgpool-recovery adopts PostgreSQL 9.3. (Tatsuo Ishii)
Patch contributed by Asif Rehman. Slight editing by Tatsuo Ishii.
[pgpool-hackers: 180]
compile error in ppool-recovery
http://www.pgpool.net/pipermail/pgpool-hackers/2013-April/000179.html
- Fix pool_has_pgpool_regclass() to check execute privilege of
pgpool_regclass(). (Tatsuo Ishii)
Even though pgpool_regclass() exists, if pgpool cannot execute the
function, the connection to backend hangs. You can reproduce the problem
by just dropping the execute privilege from pgpool_regclass and do some
insert in native replication mode.
The problem is reported in bugtrack #53.
#53 pgpool_regclass hangs all connections
Date: 2013-04-04 13:35
Reporter: tmandke
http://www.pgpool.net/mantisbt/view.php?id=53
- Fix error message mistakes in detect_postmaster_down_error(). (Tatsuo Ishii)
For example, "LOG: detect_stop_postmaster_error: detect_error error" is
fixed to "LOG: detect_postmaster_down_error: detect_error error", and so on.
===============================================================================
3.0.10 (umiyameboshi) 2013/02/08
* Version 3.0.10
This is a bugfix release against pgpool-II 3.0.9.
__________________________________________________________________
* General
- Fix race condition when using md5 authentication. (Tatsuo Ishii)
The file descriptor to pool_passwd is opened in pgpool main and pgpool
child inherits it. When concurrent connections try to authenticate md5
method, they call pool_get_passwd and seek the fd and cause random md5
auth failure because underlying fd is shared. Fix is, let individual
pgpool child open the file by calling pool_reopen_passwd_file.
Problem reported and analyzed by Jason Slagle in pgpool-general:1141.
[pgpool-general: 1141] Possible race condition in pool_get_passwd
From: Jason Slagle
Date: Sun, 28 Oct 2012 01:12:52 -0400
http://www.sraoss.jp/pipermail/pgpool-general/2012-October/001160.html
- Fix pool_send_severity_message() not to use uninitialized memory.
(Tatsuo Ishii)
It cause a segmentation fault.
Reported in Bug #33's attached valgrind output by dudee.
#33 pgpool-II 3.2.1 segfault
Reporter: dudee
Date: 2012-10-30 19:16
http://www.pgpool.net/mantisbt/view.php?id=33
- Fix reaper() not to exit wait3() loop when catches pcp or worker child
exit event. (Tatsuo Ishii)
Otherwise reaper() mistakenly ignore some process exit event and make a
risk of creating zombie process and forgetting to create new process.
Problem reported and fix suggested by Goto in [pgpool-general-jp: 1123].
http://www.sraoss.jp/pipermail/pgpool-general-jp/2012-November/001122.html
(in Japanese)
- Fix pool_search_relcache() to use MASTER or MASTER_NODE_ID macro, rather
than REAL_MASTER_NODE_ID. (Tatsuo Ishii)
In case node 0 fail back in streaming replication mode, pgpool does not
restart child process. So REAL_MASTER_NODE_ID looks for node 0 con info,
which is not present until new connection to backend made. Thus referring
to node con info results in segfault. MASTER or MASTER_NODE_ID are safe in
this situation because they look at cached former master node id.
- Fix long standing bug "portal not found" error when replication delay
is too much in streaming replication mode. (Tatsuo Ishii)
The bug had been there since the delay threshold was introduced.
We changed destination DB node if delay threshold exceeds in bind,
describe and execute. However, if parse sends to different node, bind,
describe or execute will fail because no parsed statement or portal
exists. Solution is, not to send to different parse node even
if delay threshold is too much.
- Fix pg_md5 to output "\n" after user inputs password. (Yugo Nagata)
- Fix child_exit() to not call send_frontend_exits() if there's no
connection pool. (Tatsuo Ishii)
Otherwise, it segfaults because send_frontend_exits() refers to objects
pointed to by pool_connection_pool. Per bug track #44 by tuomas.
#44 pgpool went haywire after slave shutdown triggering master failover
Reporter: tuomas
Date: 2012-12-11 00:33
http://www.pgpool.net/mantisbt/view.php?id=44
- Fix read_startup_packet() to reset alarm and free StartupPacket when
pool_read() returns 0 which means incorrect packet length. (Nozomi Anzai)
Previously, authentication timeout occurs when connected by a program
monitoring the pgpool port.It is reported in bug track #35 by tuomas.
#35 Authentication is timeout
Reporter: tuomas
Date: 2012-11-20 11:54
http://www.pgpool.net/mantisbt/view.php?id=35
- Fix long standing bug with pool_open(). (Tatsuo Ishii)
It initializes wrong buffer pointer. Actually this is harmless because the
pointer is initialized by prior memset() call, though.
- Add a description about "-f" to help message. (Tatsuo Ishii)
- Modify documents to correct information of whether a certain parameter
change requires restart. (Yugo Nagata)
- Add pool_passwd option to pgpool.conf.sample*, and documents. (Yugo Nagata)
===============================================================================
3.0.9 (umiyameboshi) 2012/10/12
* Version 3.0.9
This is a bugfix release against pgpool-II 3.0.8.
__________________________________________________________________
* General
- Fix read_startup_packet. (Tatsuo Ishii)
If packet length is lower than 0, it should
have returned immediately. Otherwise it would cause memory allocation
error later on. per pgpool-general:886.
Also add canceling alarm.
- Add NOTICE message handling to s_do_auth. (Tatsuo Ishii)
Without this, health check responses false alarm and causes failover.
per bug track:
http://www.pgpool.net/mantisbt/view.php?id=25
Also allow to receive ready for query packet *not* right after backend
keydata. I'm not sure if this could happen in the real world but the
protocol seems to allow this.
- Remove unnecessary/confusing debug log from s_do_auth.(Tatsuo Ishii)
- Fix infinite loop in SSL mode. When there's pending data in SSL layer
of frontend, pool_process_query() checks pending data in backend.
(Tatsuo Ishii)
If there's non, it loops again and checks frontend/backend receive buffer
by using is_cache_empty(). Unfortunately it first checks pending data
in SSL layer of frontend, thus goes to backend data and checks again
(infinite loop).
The solution is, if there's pending data in SSL layer of frontend and
query is not in progress, call ProcessFrontendResponse() to process new
request from frontend.
- Fix is_system_catalog to use pgpool_regclass if available.
(Tatsuo Ishii)
- Fix memory leak in pool_get_insert_table_name(). (Tatsuo Ishii)
If session context's memory contex is used for nodeToString(), memory is
not freed until session ends.
- Fix possible memory leak in nodeToString(). (Tatsuo Ishii)
Since the memory context could be session context, memory used for
String object may be considerable if user session continues for hours or
days.
See bug track #24 for more details.
- Fix long standing problem with do_query(). (Tatsuo Ishii)
When 1) extended protocol used and 2)unnamed portal is used and 3) no
explicit transaction is used, user's unnamed portal is removed by Sync
message.
This is because Sync message closes transaction and unnamed portal is
removed. This leads to "portal "" does not exist" error.
Fix is, use "Flush" message instead of Sync. Main difference between
using Sync and Flush is, Flush does not return Ready for Query message.
So do_query() does not return until all expected responses are returned.
It seems the order of messages returned from backend is random, and
do_query () manages it by using state bits.
===============================================================================
3.0.8 (umiyameboshi) 2012/08/06
* Version 3.0.8
This is a bugfix release against pgpool-II 3.0.7.
__________________________________________________________________
* General
- Adopt PostgreSQL 9.2. (Tatsuo Ishii)
__________________________________________________________________
* Bug fixes
- Fix load balance in Solaris. (Tatsuo Ishii)
Problem is, random() in using random() in Solaris results in strange
load balancing calculation.
Use srand()/rand() instead although they produce lesser quality random
Problem reported at [pgpool-general: 396].
[pgpool-general: 396] strange load balancing issue in Solaris
http://www.pgpool.net/pipermail/pgpool-general/2012-April/000397.html
- Fix segfault of pcp_systemdb_info not in parallel mode. (Nozomi Anzai)
- Fix "unnamed prepared statement does not exist" error. (Tatsuo Ishii)
This is caused by pgpool's internal query, which breaks client's
unnamed statements. To fix this, if extended query is used, named
statement/portal for internal are used for internal query.
- Fix is_system_catalog(). Its relcache was accidently defined as
"session local". (Tatsuo Ishii)
- Improve reading and writing pid_file. (Tatsuo Ishii)
- Fix pool_process_query() bug reported in [pgpool-general: 672].
(Tatsuo Ishii)
This is caused by the function waits for primary node which does not
have pending data, while standbys have pending data.
[pgpool-general: 672] Transaction never finishes
http://www.pgpool.net/pipermail/pgpool-general/2012-June/000676.html
- Fix wait_for_query_response() not to send param status to frontend if
frontend is NULL. (Tatsuo Ishii)
This could happen while processing reset_query_list and occur crash.
===============================================================================
3.0.7 (umiyameboshi) 2012/04/23
* Version 3.0.7
This is a bugfix release against pgpool-II 3.0.6.
__________________________________________________________________
* Bug fixes
- Add m4 files. This should prevent compiling problem on older
OS's. (Tatsuo Ishii)
- Fix bug that the process exits before unlocking semaphore by a
signal interrupt. (Tatsuo Ishii)
- Fix a memory leak in case of reset_query. (Tatsuo Ishii)
- Fix SimpleQuery() so that it restores parser memory context when:
1) Builtin show commands are used
2) Parallel query mode
3) Query cache is used
(Tatsuo Ishii)
- Fix pool_ssl_read() to deal with large data reading. (Tatsuo Ishii)
Original complain is here:
http://www.pgpool.net/pipermail/pgpool-general/2012-March/000299.html
- Fix hangup when PREPARE statement causes error. (Toshihiro Kitagawa)
This issue was reported by Tomonari Katsumata:
Subject: [pgpool-general: 121] question of pgpool's behavior
===============================================================================
3.0.6 (umiyameboshi) 2012/01/31
* Version 3.0.6
This version fixes various bugs since 3.0.5.
__________________________________________________________________
* Bug fixes
- Fix infinite loop reported in this thread (Tatsuo Ishii):
http://www.pgpool.net/pipermail/pgpool-general/2011-December/000099.html
It was not considered the case that, when received buffer in primary was
empty but the one in a standby was not, the standby spontaneously sent
packet to pgpool.
This could happen when, for example, reloading postgresql.conf.
The fix is that such buffer in standby is discarded.
===============================================================================
3.0.5 (umiyameboshi) 2011/10/31
* Version 3.0.5
This version fixes various bugs since 3.0.4.
__________________________________________________________________
* Bug fixes
- Fix bug with the handling of empty queries. The empty queries
come to be handled the same as SELECT queries. This fix allows
load-balance after the empty query(Toshihiro Kitagawa)
- Fix insert_lock so that it works correctly even if the column
definition such as "DEFAULT nextval(('"x_seq"'::text)::regclass)"
(Toshihiro Kitagawa)
- Fix log message which is emitted when pgpool-II cannot parse the
query in the extended query protocol so that it shows the query
(Toshihiro Kitagawa)
- Fix description about backend_weight inpgpool-II manual. It can
be changed by reloading pgpool.conf(Tatsuo Ishii)
- Fix bug which does not update the node status when reattaching the
node in raw mode(Guillaume Lelarge)
- Fix bug that SELECTs which have subquery with FOR SHARE/UPDATE clause
are sent to slave/standby(Tatsuo Ishii)
- Fix bug which rewriting timestamp of default value fails in PREPARE
statements. This used to work but was broken in 3.0(Toshihiro Kitagawa)
- Fix crash of pgpool child when frontend connects if in raw mode,
enable_hba is off and more than 2 backends(Toshihiro Kitagawa)
- Fix some memory leaks(Toshihiro Kitagawa)
__________________________________________________________________
* Enhancements
- Allow time stamp rewriting to work with arbitrary expression in
default value of a column. Before we detected anything including
now() then simply replaced it to now(). This will lead to wrong
rewriting of default value. for example, timezone('utc'::text, now()).
Note that, however, this only adopts to simple queries. Extended
protocols(for example Java, PHP PDO) or SQL "PREPARE" still remain
same(Tatsuo Ishii)
- Change error message "do_md5: read_password_packet failed" into debug
level(Toshihiro Kitagawa)
===============================================================================
3.0.4 (umiyameboshi) 2011/06/01
* Version 3.0.4
This version fixes various bugs since 3.0.3.
__________________________________________________________________
* Incompatible changes
- In streaming replication, if delay_threshold is 0 or health
checking is disabled, the delay checking is not performed.
This is the behaviour according to a description of the
pgpool-II manual. But, so far the delay checking was performed
even if health checking was disabled(Guillaume Lelarge)
__________________________________________________________________
* Bug fixes
- Fix pgpool-regclass() to be compiled in PostgreSQL 8.0 or later.
7.4 still produces errors(Tatsuo Ishii)
- Fix possible hangup when using /*NO LOAD BALANCE*/ comment in
streaming replication(Toshihiro Kitagawa)
- Fix hangup when received Flush(H) message or CloseComplete(C)
message(Toshihiro Kitagawa)
- Fix possible hangup that happen for the receiving timing of
ReadyForQuery(Z) message after pgpool-II connects to backends(Toshihiro Kitagawa)
- Add description about parameters for recovery_1st_stage_command
and recovery_2nd_stage_command(Tatsuo Ishii)
- Increase size of the internal system catalog cache from 32 to 128.
This has the effect of reducing "unnamed prepared statement does
not exist" error(Tatsuo, Kitagawa)
- Fix bug with pcp_connect() which causes double free. Patch
contributed by Jehan-Guillaume (ioguix) de Rorthais(Tatsuo Ishii)
- Fix bug with start_recovery() which is apparently wrong usage of
PQfinish()(Tatsuo Ishii)
- Fix incorrect error message which is sent to the frontend when
client idle time reached client_idle_limit(Tatsuo Ishii)
- Fix "backend status" variable name correctly in pool_status.
Replace the space with a '_'(Guillaume Lelarge)
- Fix hangup when using md5 authentication method and running as
daemon. Patch contributed by Nicolas Thauvin(Tatsuo Ishii)
- Fix log_per_node_statement so that it prints statements in the
extended query protocol. This used to work but was broken in 3.0
(Toshihiro Kitagawa)
__________________________________________________________________
* Enhancements
- Add currval() and lastval() to black_function_list of sample
configuration files. If they are load balanced, currval() or
lastval() may be called before the result of nextval() or setval()
is propagated to slaves(Tatsuo Ishii)
===============================================================================
3.0.3 (umiyameboshi) 2011/02/23
* Version 3.0.3
This version fixes various bugs since 3.0.1. Please note that
3.0.2 was canceled due to a packaging problem.
__________________________________________________________________
* Incompatible changes
- Now installing C function "pgpool_walrecrunning()" is recommended
if you plan to use streaming replication mode.
This is necessary for better use of online recovery in the mode.
Also new variable "%P" can be used in the online recovery script.
If you do not install the function, these functionalities cannot be
used(Tatsuo Ishii).
- In raw mode if there's only one DB node and if a problem arises
with the DB node, it will be brought to down status. However if
the DB node goes into good condition again, you can use the DB
node without restarting pgpool. This change has been included in
3.0, but did not work(Tatsuo, Kitagawa)
__________________________________________________________________
* Bug fixes
- Fix non portable code in password authentication.
Bug report from a FreeBSD user(Tatsuo Ishii)
- Fix bug that insert_lock locks all rows in user table
(Tatsuo, Kitagawa)
- Fix bug with password authentication. If user name is 32 bytes
long, pgpool child segfaults.(Tatsuo Ishii)
- Fix bug with md5 authentication. If raw mode or number of
backend is 1, pgpool child segfaults. Patch contributed by
Rob Shepherd(Tatsuo Ishii)
- Fix long standing bug with timestamp rewriting against array
and complex types. Patch contributed by Akio Ishida(Tatsuo Ishii)
- Fix bug that debug_level directive doesn't work. Patch
contributed by Gilles Darold(Tatsuo Ishii)
- Fix possible crash of pgpool child while doing failover(Toshihiro Kitagawa)
- Fix white/black_function_list so that it works correctly when user
calls function with schema name(Tatsuo Ishii)
- Fix bug that DROP DATABASE fails by connection cache(Toshihiro Kitagawa)
- Fix bug that failover fails in raw mode(Toshihiro Kitagawa)
- Fix possible termination of pgpool child when both simple query
protocol and extended query protocol are used in one session
(Toshihiro Kitagawa)
- Fix possible hang up when an error occurs while using extended
query protocol(Toshihiro Kitagawa)
- Fix pgpool-regclass() so that it doesn't use PG_TRY/CATCH.
It appeared that using PG_TRY/CATCH is not safe, sometimes backend
dies with PANIC: ERRORDATA_STACK_SIZE exceeded.(Tatsuo Ishii)
- Fix bug that select query isn't sent to master node when it meets
the following conditions(Toshihiro Kitagawa)
- in MASTER/SLAVE mode
- use extended query protocol
- started transaction explicitly
- after write queries
- Fix bug with load_balance that JDBC driver sends BEGIN to master node
many times(Toshihiro Kitagawa)
- Fix pool_status so that failback_command and fail_over_on_backend_error
show correct values(Toshihiro Kitagawa)
- Remove parameters from pool_status: recovery_password,
system_db_password(Toshihiro Kitagawa)
- Fix online recovery problem in the streaming replication
mode(Tatsuo Ishii). Consider following scenario. Suppose node 0 is
the initial primary server and 1 is the initial standby
server.
1) Node 0 going down and node 1 promotes to new primary.
2) Recover node 0 as new standby.
3) pgpool-II assumes that node 0 is the new primary.
This problem happens because pgpool-II regarded unconditionally
the youngest node to be the primary. pgpool-II 3.0.3 now checks
each node by using pgpool_walrecrunning() to see if it is a
actually primary or not and is able to avoid the problem and
regards node as standby correctly. Also you can use new
variable "%P" to be used in the recovery script. If you do
not install the function, the above problem is not resolved.
- Fix backend complaining "unexpected EOF on client connection"
while doing failover in streaming replication mode(Tatsuo Ishii)
- Fix pgpool crashes when all backends go down(Tatsuo Ishii)
- Fix replication delay checking so that it does not keep persistent
connection to backends. Because the persistent connection may
become bogus if a node down and then wake up between replication
delay checking period(Tatsuo Ishii)
- Rewrite and review english document(Marc Cousin, Gleu)
__________________________________________________________________
* Enhancements
- Emit log if particular backend is down status while reading
the status file(Tatsuo Ishii)
- Emit error message if an error occurred by the query that
pgpool executed(Tatsuo Ishii)
- Add sql directories main Makefile(Tatsuo Ishii)
===============================================================================
3.0.1 (umiyameboshi) 2010/10/19
* Version 3.0.1
This version fixes various bug in 3.0.
__________________________________________________________________
* Bug fixes
- Fix bug with md5 auth. If there's more than 1 servers to be
authenticated, it segfaults(Tatsuo Ishii)
- Fix bug that a child process crashes when clients execute a query
contains syntax error in extended query protocol(Toshihiro Kitagawa)
- Fix bug with handling of portal information, it terminates
a child process(Toshihiro Kitagawa)
- Fix hungup when a query sent to one node caused an error
in extended query protocol(Toshihiro Kitagawa)
- Fix typo in English doc. Patch contributed by Asaf Ohaion(Tatsuo Ishii)
===============================================================================
3.0 (umiyameboshi) 2010/09/10
* Version 3.0
This is the first version of pgpool-II 3.0 series.
That is, a "major version up" from 2.2 or 2.3 series.
The biggest news is, this version adapts to PostgreSQL 9.0's new
feature: Streaming Replication/Hot Standby. Streaming
replication can be used as a sub mode of master slave
mode. Master slave mode itself heavily enhanced:
- SELECTs in explicit transactions can be load balanced
- In extended protocol, PARSE/BIND/DESCRIBE messages are sent to
the node which execute EXECUTE message, not all node. This
will reduce lock contentions.
- Auto start of transaction happens only when it needed.
- Temporary tables can be used safely.
- SELECT which calls functions possibly write to database
executes on master(primary)
Also many new features are added and major refactoring has been
made to the internal structure of pgpool-II. For example, in
replication mode, SELECTs calling functions possibly write to
database will not allow to load balance.
__________________________________________________________________
* New features
- Online recovery can be used with master/slave/streaming
replication mode(Tatsuo Ishii)
- New directive "delay_threshold" is added to monitor
replication delay in master/slave/streaming replication
mode. If replication delay is too much, SELECTs are not load
balanced(Tatsuo Ishii)
- show pool_status shows replication delay in
master/slave/streaming replication mode(Tatsuo Ishii)
- New directive "log_standby_delay" is added to control logging of
replication delay in master/slave/streaming replication
mode(Tatsuo Ishii)
- When insert_lock is enabled and the table includes SERIAL data
type, issue row lock on the sequence table. Before we issues
table lock. Problem is, the table lock conflicts with auto
vacuum and sometimes caused excessive lock waiting(Tatsuo Ishii)
- Add support for more "SHOW" commands: pool_nodes,
pool_processes, pool_pools, and pool_version(Guillaume Lelarge)
- Backend process id and whether frontend connects to this
connection pool or not are added to pcp_proc_info's
output(Tatsuo Ishii)
- "Gracefully detach" option is added to pcp_detach_node. With
this option, pcp_detach_node waits until all frontends
disconnected(Tatsuo Ishii)
- New directive "white_function_list" and "black_function_list"
are added to register functions those do not or do write to
database(Tatsuo Ishii)
- In master/slave mode, SELECTs to system catalogs executes only
on master/primary(Tatsuo Ishii)
- In master/slave mode, SELECTs to temporary table executes only
on master/primary(Tatsuo Ishii)
- In master/slave mode, write queries outside of explicit
transactions no longer trigger to start internal
transaction(Tatsuo Ishii)
- In master/slave mode, SELECTs inside explicit transactions are
load balanced(Tatsuo, Kitagawa)
- In master/slave mode, commands are no longer sent to all DB
nodes. This will prevent unnecessary locking(Tatsuo, Kitagawa)
- New command option adds to ignore the status file when
starting up(Tatsuo Ishii)
- Supports PostgreSQL 9.0's new VACUUM syntax(Tatsuo Ishii)
- New directive "failover_if_affected_tuples_mismatch" controls
the behavior when number of result rows of
INSERT/UPDATE/DELETE are differ(Tatsuo Ishii)
- When number of result rows of INSERT/UPDATE/DELETE are
differ, each number are logged(Tatsuo Ishii)
- md5 authentication is supported in replication mode and
master/slave mode(Tatsuo Ishii)
- Allow to force to move to online recovery second stage even
there are connecting frontends(Tatsuo Ishii)
- If there's only one DB node and it triggers failover,
pgpool-II will automatically connects if the DB node coming
up(Tatsuo Ishii)
- Pcp commands supports long options(Guillaume Lelarge)
- New directive "debug_level" added to control the debug message
logging(Tatsuo Ishii)
- Allow to use various boolean representations as PostgreSQL in
pgpool.conf(Toshihiro Kitagawa)
- New C language function pgpool_switch_xlog for online recovery
added(Toshihiro Kitagawa)
- New C language function pgpool_regclass added to avoid a trouble
about handling of duplicate table names in different schema(Tatsuo Ishii)
__________________________________________________________________
* Bug fixes
- Do not rewrite statement which accesses columns having now()
etc. as the default value but the data type are not timestamp
etc. Otherwise we have an error in DMLs(Tatsuo Ishii)
- Fix timestamp rewriting not to omit schema qualification(Tatsuo Ishii)
- Fix bug with timeout handling in pcp commands(Tatsuo Ishii)
- Fix SSL hang when large amount of data transferred(Tatsuo Ishii)
- Fix failover when there's only one DB node(Tatsuo Ishii)
- Fix bug with postmaster start check in online recovery.
Before it continued infinitely to try to connect to postmaster
if the first attempt failed(Tatsuo Ishii)
===============================================================================
2.3 Series (2009/12/07 - 2012/08/06)
===============================================================================
2.3.4 (tomiteboshi) 2012/08/06
* Version 2.3.4
This version fixes various bugs since 2.3.3.
__________________________________________________________________
* Bug fixes
- Fix do_error_execute_command() so that it discards responses from
backend until ErrorResponse received. (Toshihiro Kitagawa)
Note that we need to preserve non-error responses (i.e. ReadyForQuery)
and put back them using pool_unread().
Otherwise, ReadyForQuery response of DEALLOCATE. This could happen if
PHP PDO used.
- Fix SimpleForwardToFrontend() so that it reset select_in_transaction
flag and execute_select flag when bind error occurred while executing
SELECT. (Toshihiro Kitagawa)
- Fix SSL connection sometimes hung if lots of data read from backend.
This is caused by the buffering in OpenSSL layer. To fix the problem,
(Tatsuo Ishii)
we check the buffer has any pending data by using SSL_pending() before
calling select(2).
See thread [Pgpool-general] Fwd: PGPOOL II 2.3.3 hang in ssl mode for
more details.
- Fix bug with pcp_check_fd()'s timeout handling. (Tatsuo Ishii)
Per erboles.
Subject: [Pgpool-general] question about pcp_check_fd
Date: Sun, 23 May 2010 18:21:41 -0500
To: pgpool <pgpool-general@pgfoundry.org>
- Do not force replication of DEALLOCATE if operated in master/slave mode.
Reported by Jan Kantert. (Toshihiro Kitagawa)
See:
Subject: [Pgpool-hackers] Problems with PgPool 2.3.3 Prepare /
Deallocation handling in Master/Slave mode
Date: Fri, 28 May 2010 20:59:47 +0200
For more details.
- Make timestamp rewriting schema aware. (Tatsuo Ishii)
- Do not rewrite statement which accesses columns having now() etc. as the
default value but the data type are not timestamp etc. (Tatsuo Ishii)
Otherwise we have an error in DMLS. See:
Subject: [Pgpool-general] function epoch seems to be causing error
To: pgpool-general@pgfoundry.org
Date: Mon, 16 Aug 2010 21:48:31 +0000 (UTC)
For more details.
- Fix insert_lock to be schema aware. (Tatsuo Ishii)
- Fix long standing bug with timestamp rewriting against array and complex
types. (Tatsuo Ishii)
Failed examples are:
INSERT INTO r1(col[1], col2.foo) VALUES (1, 2); -- insert_column_item
UPDATE r1 SET col1[1] = 1, col2.foo = 1; -- set_target
PREPARE "p" (int4[]) AS SELECT $1[1]; -- c_expr
SELECT (ARRAY[1,2,3])[1];
SELECT (ARRAY[ARRAY[1]])[1][1];
SELECT ('{1,2,3}'::int[])[1];
SELECT ('{1,2,3}'::int[3])[1];
SELECT r1.col[1], (r1.col1).bar, (r1.col1).* FROM r1; -- columnref
SELECT (r1.col1).baz[1], (r1.col1).baz[1][2] FROM r1;
Patch provided by Akio Ishida.
- Fix buffer overrun problem when pcp password is longer than 32.
(Tatsuo Ishii)
- Fix wait_for_query_response() not to send param status to frontend if
frontend is NULL. This could happen while processing reset_query_list.
(Tatsuo Ishii)
===============================================================================
2.3.3 (tomiteboshi) 2010/04/23
* Version 2.3.3
This version fixes various bugs since 2.3.2.2.
__________________________________________________________________
* Incompatible changes
- Please note that this version of pgpool consumes more shared
memory than before. If you encounter problems when starting up
pgpool, please look into pgpool log. If you find messages
something like "could not create shared memory segment: Cannot
allocate memory", please increase the shared memory on your
system.
- Now parallel mode requires replication mode turned
on. parallel mode without replication mode turned on has been
broken since pgpool-II was born anyway(Toshihiro Kitagawa)
- Change default value for insert_lock to false since there's no
point in turning this on in master/slave mode. Fix suggested by
Fujii Masao(Tatsuo Ishii)
__________________________________________________________________
* Newly added documents
- README.online-recovery, which is an internal document of
online recovery, added(Tatsuo Ishii)
__________________________________________________________________
* Bug fixes
- Fix long standing bug since pgpool-II 1.0 which causes
segfault of pgpool child process. This was caused by
miscalculation of shmem size in pgpool parent. Bug analysis by
Kitagawa patch created by Tatsuo
- Add restriction for parallel mode(Toshihiro Kitagawa)
- The Natural Join is not supported
- The USING CLAUSE is converted to ON CLAUSE by query rewrite
process
- Fix possible crash during rewriting JOIN syntax that have
USING in parallel query mode(Toshihiro Kitagawa)
This fix is supporting such as following JOIN syntax.
example:
- SELECT * FROM a JOIN b USING (aid) JOIN c USING (cid);
- SELECT * FROM a JOIN b USING (aid) JOIN c USING (cid)
JOIN d USING (did)
- Fix parallel query so that it can parse INSERT statements that
have current_time before a partitioning key column
(Toshihiro Kitagawa)
- Fix SimpleForwardToBackend() so that pgpool doesn't keep
waiting for reply from a backend, when clients using the
extended query protocol cause a command error such as bind
error. This bug occur in master/slave, raw, and connection
pool mode. This fix is, sending SYNC message to recover error
after command error(Toshihiro Kitagawa)
- Fix SIGINT/SIGQUIT is ignored if pgpool child is in
select(). In this case pgpool retries select() thus the signal
is ignored(Tatsuo Ishii)
- Fix connect_inet_domain_socket_by_port/
connect_unix_domain_socket_by_port so that they check if
SIGTERM/SIGINT/SIGQUIT signal has been delivered. Per bug
report from Daniel Codina(Tatsuo Ishii)
- Fix possible crash during creating "kind mismatch" error
message. This used to work but was broken in 2.3.2(Tatsuo Ishii)
- Fix bug with health checking. If a network problem such as
unplugged wire happens while calling connect(), health
checking does not work since
connect_unix_domain_socket()/connect_inet_domain_socket() do
retry if connect() is interrupted by ALARM signal. Added new
retry argument which controls the retrying behavior to those
functions. Per bug report and problem analysis by Daniel
Codina(Tatsuo Ishii)
- Fix enbug in 2.3.2.2 with time stamp rewriting in
SimpleForwardToBackend. Per bug report from Bugtrack #1010771.
Report from Peter Pramberge(Tatsuo Ishii)
- Fix rewriting "*" in parallel query. Patch contributed by
sho-san(Toshihiro Kitagawa)
- Fix connect_inet_domain_socket_by_port() so that it print out
error message by using hstrerror(), rather than
strerror()(Tatsuo Ishii)
===============================================================================
2.3.2.2 (tomiteboshi) 2010/02/22
* Version 2.3.2.2
This version fixes various bug in 2.3.x.
- When rewriting timestamp in extended query, it allocated less
than what it actually needed. This causes random problematic
behavior, typically "message: invalid string in message" error
in backend(Tatsuo Ishii).
- In extended query, if one of parameters contains NULL, ppool
crashes(Tatsuo Ishii).
- If in previous status file all nodes were marked down status,
it is regarded that this file is bogus. This will prevent "all
node down" syndrome(Tatsuo Ishii).
===============================================================================
2.3.2.1 (tomiteboshi) 2010/02/11
* Version 2.3.2.1
This version fixes bug in 2.3.x. It is identified that
pgpool-II 2.3.x has a problem with erroneous query
processing(Akio Ishida).
===============================================================================
2.3.2 (tomiteboshi) 2010/02/07
* Version 2.3.2
This version includes various fixes for bugs in 2.3.1 or before.
All 2.3.x users are encouraged to upgrade to 2.3.2 as soon as
possible.
Also this version enables long awaited SSL support and large
object replication support.
__________________________________________________________________
* Enhancements
- SSL support(Sean Finney)
- Large object replication support. You need PostgreSQL 8.1 or
later, however(Tatsuo Ishii)
- Emit statement log when error or notice message comes from
query parsing process. This is useful because PostgreSQL does
not log particular statement if the error was detected
*before* raw parser get executed. This typically happens
when encoding error was found(Tatsuo Ishii)
- Display original query to log if kind mismatch error was
caused by DEALLOCATE(Tatsuo Ishii)
- While health checking and recovery use postgres database if
possible. If postgres database does not exist, use template1
as it stands now. While connecting template1, certain
commands, for example DROP DATABASE cannot used. Using postgres
database allows to use these commands while recovery(Tatsuo Ishii)
__________________________________________________________________
* Bug fixes
- Fix errors in timestamp rewriting which occasionally cause
broken packet sentto slave nodes(Tatsuo Ishii)
- Fix errors when timestamp rewriting is used with V2
protocol(Toshihiro Kitagawa)
- Propagate Bind, Describe and Close messages to only master
node if running in master/slave and in transaction (Tatsuo Ishii)
- Fix do_child() so that check_stop_request() exits immediately
when smart shutdown signal has been sent. This has been used
to work in 2.2(Toshihiro Kitagawa)
- Fix ProcessFrontendResponse not to accept invalid frontend
packet(Xavier Noguer)
- Use %dz for sizeof in fprintf for more portability(Tatsuo Ishii)
- Fix compiler warnings(Tatsuo Ishii)
- Do not force replication of DEALLOCATE if operated in
master/slave mode. Now that pgpool do not execute PARSE in all
nodes, this was pointless and caused problem (kind mismatch
when executing DEALLOCATE)(Tatsuo Ishii)
===============================================================================
2.3.1 (tomiteboshi) 2009/12/18
* Version 2.3.1
This version includes various fixes for bugs in 2.3 or before.
All 2.3 users are encouraged to upgrade to 2.3.1 as soon as
possible.
__________________________________________________________________
* Bug fixes
- If all of following conditions met, incorrect data is written
to DB(Tatsuo Ishii)
- pgpool is running in replication mode
- pgpool is running on 64bit OS
- INSERT or UPDATE are used which explicitly include now(),
- CURRENT_TIMESTAMP, CURRENT_DATE, CURRENT_TIME. Or the target
- Table's default value use above functions
- The SQL statement includes out of 32bit
integer value(-2147483648 to 2147483647 in decimal)
Example SQL: INSERT INTO t1(id, regdate) VALUES(98887776655,
NOW());
- Fix crush in case of more than 18 DB nodes are used(Tatsuo Ishii)
- Enhance kind mismatch error message. If kind is ERROR or
NOTICE, the error or notice message from PostgreSQL will be printed
(Tatsuo Ishii)
===============================================================================
2.3 (tomiteboshi) 2009/12/07
* Version 2.3
This version enhances replication, especially CURRENT_TIMESTAMP,
CURRENT_DATE, now() etc. now can be properly replicated. Also
performance of replication when num_init_children == 1 is
enhanced. Pgpool-II now records the status of down nodes, and
remember when it restarts to ensure that keep the node status as
before. Also some logs are enhanced and more fine fail over
controls are added. Please note that pgpool-II 2.3 includes all
of enhancements and fixes of pgpool-II 2.2.1 to 2.2.6.
__________________________________________________________________
* Incompatibilities from 2.2.x
- pgpool_status file is created under logdir. So you need to
give write permission to the directory so that pgpool-II can
read/write pgpool_status file.
__________________________________________________________________
* Enhancements
- Enable proper replication of results of temporal functions
(CURRENT_TIMESTAMP, CURRENT_DATE, now() etc.). Now
applications can execute INSERT/UPDATE tables which include
default values using those temporal functions. There are small
limitations. See restriction sections of docs for more
details (Akio Ishida)
- Use PostgreSQL 8.4's SQL parser(Akio Ishida)
- Enhance the performance 20% to 100% of replication when
num_init_children == 1(Tatsuo Ishii)
- Add new directive log_per_node_statement which is similar to
log_statement except that prints info for each DB node to make
it easier which query is sent to which DB node(Tatsuo Ishii)
- Add new directive fail_over_on_backend_error to control the
behavior of fail over(Tatsuo Ishii)
- Record DB node status and remember when pgpool-II restarts(Tatsuo Ishii)
- EXPLAIN and EXPLAIN ANALYZE for SELECT query are now load
balanced. This will prevent unwanted kind mismatch errors when
EXPLAIN produces slightly different plan(Tatsuo Ishii)
- Enhance CSS of pgpool-ja.html(Tatsuo Ishii)
- Add sample configuration file for replication mode and
master/slave mode(Tatsuo Ishii)
- Add test for temporal data(Akio Ishida)
===============================================================================
2.2 Series (2009/02/08 - 2012/08/06)
===============================================================================
2.2.8 (urukiboshi) 2012/08/06
* Version 2.2.8
It includes various fixes for bugs various bug fixes in 2.2.7.
__________________________________________________________________
* Bug fixes
- Fix do_error_execute_command() so that it discards responses from
backend until ErrorResponse received. (Toshihiro Kitagawa)
Note that we need to preserve non-error responses (i.e. ReadyForQuery)
and put back them using pool_unread().
Otherwise, ReadyForQuery response of DEALLOCATE. This could happen if
PHP PDO used.
- Fix SimpleForwardToFrontend() so that it reset select_in_transaction
flag and execute_select flag when bind error occurred while executing
SELECT. (Toshihiro Kitagawa)
- Fix bug with pcp_check_fd()'s timeout handling. (Tatsuo Ishii)
Per erboles.
Subject: [Pgpool-general] question about pcp_check_fd
Date: Sun, 23 May 2010 18:21:41 -0500
To: pgpool <pgpool-general@pgfoundry.org>
- Fix buffer overrun problem when pcp password is longer than 32.
(Tatsuo Ishii)
- Fix wait_for_query_response() not to send param status to frontend if
frontend is NULL. This could happen while processing reset_query_list.
(Tatsuo Ishii)
===============================================================================
2.2.7 (urukiboshi) 2010/04/15
* Version 2.2.7
This version enhances displaying error messages when kind
mismatch error occurs. Also it includes various fixes for bugs
in 2.2.6 or before as usual.
__________________________________________________________________
* Bug fixes
- Fix occasional hangup in extend protocol + master/slave mode,
row mode or connection pool mode. Back patch from 2.3
tree(Toshihiro Kitagawa)
- Fix long standing bug since pgpool-II 1.0 which causes
segfault of pgpool child process. This was caused by
miscalculation of shmem size in pgpool parent. Bug analysis by
Kitagawa patch created by Tatsuo
- Send Parse, Bind, Describe and Close message to only master
node if operated in explicit transaction and master/slave
mode(Tatsuo Ishii).
- Emit a log when postmaster goes down(Tatsuo Ishii)
- Fix memory leak in make_persistent_db_connection(Xavier
Noguer)
- Do not force replication of DEALLOCATE if operated in
master/slave mode. Now that pgpool do not execute PARSE in all
nodes, this was pointless and caused problem (kind mismatch
when executing DEALLOCATE) (Tatsuo Ishii)
- Fix crash with show pool_status when there many (more than 18)
DB nodes(Tatsuo Ishii)
- Enhance "kind mismatch" message. If kind is ERROR or NOTICE,
print the ERROR/NOTICE message to help users to find what's
going on(Tatsuo Ishii)
===============================================================================
2.2.6 (urukiboshi) 2009/12/01
* Version 2.2.6
This version enhances handling of backend weight. Also it allows
to use temp tables in master/slave mode. It includes various
fixes for bugs in 2.2.5 or before as usual.
__________________________________________________________________
* Bug fixes
- Do not allow to load balance DECLARE, CLOSE, FETCH and
MOVE. If data gets updated and CLOSE issued after transaction
commit(i.e. holdbale cursor), this will cause data
inconsistency since CLOSE is executed one of the severs,
rather than all(Tatsuo Ishii)
- In master/slave mode, execute Parse message on only master
node. In previous versions Parse executed on all nodes, which
grabbed unnecessary lock(Tatsuo Ishii)
- Remove init script from all runlevels before uninstall(Devrim)
- Fix pgpool.spec(Devrim)
- Do not execute REINDEX DATABASE or SYSTEM, CREATE/DROP TABLE
SPACE inside a transaction block(Tatsuo Ishii)
__________________________________________________________________
* Enhancements
- Allow to change weight by reloading pgpool.conf. This will take
effect for next client sessions(Tatsuo Ishii)
- Reply with useful error messages, rather than "server closed
the connection unexpectedly" when authentication fails(Glyn
Astill)
- Add info to logs when writing to sockets fails to know if it
was for backend or frontend(Tatsuo Ishii)
- Do not complain when writing to socket of frontend
fails(Tatsuo Ishii)
- Allow to use temp tables in master/slave
mode. INSERT/UPDATE/DELETE will automatically be sent to
master only. Still SELECT you need to add /*NO LOAD BALANCE*/
comment(Tatsuo Ishii)
- Add temp table test to test/jdbc(Tatsuo Ishii)
===============================================================================
2.2.5 (urukiboshi) 2009/10/4
* Version 2.2.5
This version fixes various bugs in 2.2.4 or before.
__________________________________________________________________
* Bug fixes
- Fix connection_count_down(). It decrements the connection
counter too much in some corner cases and causes online
recover never completes(Tatsuo Ishii)
- Detect frontend exiting while waiting for commands complete in
other cases such as internal locks are issued and Parse
(Tatsuo Ishii)
- Fix infinite loop in reset_backend(Xavier Noguer, Tatsuo)
- Fix Parse() to print actual query when it detects kind
mismatch error(Tatsuo Ishii)
- Document enhancements(Tatsuo Ishii)
===============================================================================
2.2.4 (urukiboshi) 2009/8/24
* Version 2.2.4
This version fixes various bugs in 2.2.3 or before.
__________________________________________________________________
* Bug fixes
- Fix possible bug introduced in pgpool-II 2.2.2. Load balance
control variables may remain not be restored and subsequent
DML/DDL call might sent to only master node(Tatsuo Ishii)
- Send NOTICE message to frontend periodically if V2 protocol is
used. This is ifdef out since it affects visible change to
applications. 2.2.3 unconditionally sends param packet to
client even it uses version 2 protocol, which is apparently
wrong. Also tweak checking period from 1 second to 30 seconds
since 1 second seems too aggressive(Tatsuo Ishii)
- Block signals before forking children rather after. Otherwise
parent will be killed by failover signal if it receives a
signal before establishing signal handler(Tatsuo Ishii)
- Remove unnecessary spaces and tabs at the end of line(Jun Kuriyama)
===============================================================================
2.2.3 (urukiboshi) 2009/8/11
* Version 2.2.3
This version fixes various bugs in 2.2.2 or before.
__________________________________________________________________
* Bug fixes
- Fix child process death if one of backends is not available(Tatsuo Ishii).
- Fix various parallel query bugs(Yoshiharu Mori)
- Fix message corruption for kid mismatch error(Akio Ishida)
- Now statement_time works(Tatsuo Ishii)
- Enhance health checking to detect postmaster stopping by
SIGSTOP(Tatsuo Ishii)
- Detect frontend abnormal exiting while waiting for reply from
backend. This only works with V3 protocol(Tatsuo Ishii)
- Do not start internal transaction if command is CLUSTER
without arguments(Tatsuo Ishii)
- Fix bug with COPY FROM in that backend process remains after
COPY failed(Tatsuo Ishii)
__________________________________________________________________
* Enhancements
- Show last query for extended protocol(Akio Ishida)
- Allow to compile sql/pgpool-recovery/pgpool-recovery.c with
PostgreSQL 8.4(Tatsuo Ishii)
===============================================================================
2.2.2 (urukiboshi) 2009/5/5
* Version 2.2.2
This version fixes various bugs in 2.2.1 or before. Please note
that an important fix is made to avoid data inconsistency risk,
which could happen when client does not exit gracefully(without
sending "X" packet) while pgpool is trying to send data to
it. This could happen with all version of pgpool-II.
__________________________________________________________________
* Bug fixes
- Ignore write error on frontend connection. This is needed to
continue processing with backend, otherwise we risk data
inconsistency(Tatsuo Ishii)
- Fix bug introduced in 2.2.1 (In master slave mode, sometimes
DEALLOCATE fails). If prepared statement reused, pgpool
hangs(Toshihiro Kitagawa)
- Fix pgpool crash when SQL command PREPARE and protocol level
EXECUTE are mixed. The bug was introduced in 2.2(Tatsuo Ishii)
- Avoid "unexpected EOF on client connection" error in PostgreSQL
when reset query fails(Tatsuo Ishii)
===============================================================================
2.2.1 (urukiboshi) 2009/4/25
* Version 2.2.1
This version fixes various bugs in 2.2.
__________________________________________________________________
* Bug fixes
- In master slave mode, sometimes DEALLOCATE fails. This is
caused by that the first PREPARE was not executed on the
slave(Toshihiro Kitagawa)
- Update pgpool.spec along with related files(Devrim)
- Fix insert_lock so that it is ignored when protocol version is
2(Tatsuo Ishii)
- Remove excessive log messages regarding parameter change notice(Tatsuo Ishii)
- Add missing files to doc(Tatsuo Ishii)
===============================================================================
2.2 (urukiboshi) 2009/2/28
* Version 2.2
This version enhances SERIAL data type handling and on line
recovery. Also an important bug, serializable transactions could
cause data inconsistency among DB nodes, is fixed. Query
cancelation, which never worked since pgpool-II was born, is
finally fixed.
__________________________________________________________________
* New features/enhancements
- With insert_lock, now a table is locked only if it has
SERIAL data type and now the default value for insert_lock
is true(Tatsuo Ishii)
- Start internal transaction other than INSERT, UPDATE, DELETE
and SELECT to keep node consistency(Tatsuo Ishii)
- Add client_idle_limit_in_recovery directive. This will
prevent 2nd stage of on line recovery from not going forward
by idle clients sitting forever(Tatsuo Ishii)
- Add pid_file_name directive which specifies a path to the
file containing pgpool process id. "logdir" is no more used(Tatsuo Ishii)
- Allow to load balance DECLARE, FETCH and CLOSE(Tatsuo Ishii)
- Add -d option to pcp commands(Jun Kuriyama)
- Enhance kind mismatch error message to include original
query string(Tatsuo Ishii)
__________________________________________________________________
* Bug fixes
- Close all file descriptors when running in daemon mode.
Otherwise we inherit sockets from apache when it's
started by pgpoolAdmin. This results in that port 80 is
occupied for example. Patch provided by Akio
Ishida. Also add chdir("/"). This is always good for
daemon programs(Tatsuo Ishii)
- Allow MD5 authentication in raw mode as stated in docs(Tatsuo Ishii)
- Check transaction serialization failure error in
serializable mode and abort all nodes if so. Otherwise
we allow data inconsistency among DB nodes(Tatsuo Ishii).
See following scenario: (M:master, S:slave)
M:S1:BEGIN;
M:S2:BEGIN;
S:S1:BEGIN;
S:S2:BEGIN;
M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
M:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
S:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
M:S1:UPDATE t1 SET i = i + 1;
S:S1:UPDATE t1 SET i = i + 1;
M:S2:UPDATE t1 SET i = i + 1; <-- blocked
S:S1:COMMIT;
M:S1:COMMIT;
M:S2:ERROR: could not serialize access due to concurrent update
S:S2:UPDATE t1 SET i = i + 1; <-- success in UPDATE and data
becomes inconsistent!
- avoid kind mismatch error caused by "SET TRANSACTION
ISOLATION LEVEL must be called before any query"(Tatsuo Ishii).
This could happen in following scenario:
M:S1:BEGIN;
S:S1:BEGIN;
M:S1:SELECT 1; <-- only sent to MASTER
M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
M: <-- error
S: <-- ok since no previous SELECT is sent. kind mismatch error occurs!
- Process status display has extra space on FreeBSD(Jun Kuriyama)
- Fix incorrect kind mismatch detection case. e.g: BEGIN;
BEGIN; (Tatsuo Ishii)
- If PostgreSQL sends lots of DEBUG message, sometimes pgpool
complains:
2008-11-08 22:41:53 ERROR: pid 23744: do_command: backend does not
return ReadyForQuery. This due to a wrong assumption for the
client/server protocol(Tatsuo Ishii)
- Fix the case when sending an erroneous query to abort
transaction. It assumed that after sending an error query,
always ReadyForQuery came right after that. If some
debugging or logging verboseness is set, PostgreSQL might
sends NOTICE before ReadyForQuery(Tatsuo Ishii)
- Query cancelation now works. It never worked since pgpool-II
was born(Tatsuo Ishii)
- Fix online recovery to wait for failback done before
allowing to accept connections from clients. It was supposed
to work like this but actually was not since the day 0 when
online recovery was born. Without the fix there could be
potential data inconsistency among DB nodes(Tatsuo Ishii)
- Fix pgpool-II crash after on line recovery. This happens
after the failback process adds a recovered node which has
no connection to the node(Tatsuo Ishii)
- Fix pgpool-II errors when postgresql.conf is reloaded. This
was caused by parameter status packet sent asynchronously
from backend, which indicates the internal setting of
backend has been changed(Tatsuo Ishii)
__________________________________________________________________
* Incompatible changes
- Always fail over and restart all children. Before we do
restart only if master has not been changed. This is
wrong. If we have trouble with network cable or something,
TCP/IP stack keeps on retrying for long time and the only
way to prevent it is restarting process(Tatsuo Ishii)
- "logdir" is no more used. Instead use
"pid_file_name"(Tatsuo Ishii)
- Default value for insert_lock is now true(Tatsuo Ishii)
===============================================================================
2.1 Series (2008/07/25 - 2008/07/25)
===============================================================================
2.1 (inamiboshi) 2008/7/25
* Version 2.1
__________________________________________________________________
* New feature
- Add '%m' format to failover_command and failback_command to
obtain new master node ID. (Yoshiyuki Asaba)
- Add '%m' format to failover_command and failback_command to
obtain old master node ID. (Yoshiyuki Asaba)
- Add new directive "recovery_timeout" to specify recovery
timeout in second. (Taiki Yamaguchi)
- Add optino '-v' to print pgpool version. (Yoshiyuki Asaba)
__________________________________________________________________
* Incompatibility
- Restrict pgpool_recovery() and pgpool_remote_start()
functions to superusers. (Yoshiyuki Asaba)
- Do not create a connection pool to standby node in raw
mode. (Yoshiyuki Asaba)
- Remove "replication_timeout" parameter. (Yoshiyuki Asaba)
- This enabled if replication_strict was false. However,
replication_strict was already removed.
- Ignore timeout argument of pcp commands. (Taiki Yamaguchi)
- Do not replicate "COPY TO STDOUT" when replicate_select is
false. (Yoshiyuki Asaba)
__________________________________________________________________
* Bug fix
** General
- Fix crash when CloseComplete message was
received. (Yoshiyuki Asaba)
- Improve network I/O routine. (Yoshiyuki Asaba)
- Fix compile errors on Solaris 10. (Yoshiyuki Asaba)
- Improve log messages of health check and recovery. (Tatsuo Ishii)
- Change error level of the "failed to read kind from
frontend" message from ERROR to LOG. (Yoshiyuki Asaba)
- Fix failover failure in raw mode. (Taiki Yamaguchi)
- Fix zombie process bug. (Yoshiyuki Asaba)
- Fix health_check_timeout to work correctly. (Kenichi Sawada)
- Support ps status on FreeBSD. (ISHIDA Akio)
- Improve bind(2) failure report. (Jun Kuriyama)
- Improve error message when client authentication
failed. (Tatsuo Ishii)
** Replication
- Fix replicate_select to work correctly. (Tatsuo Ishii)
- Fix a wrong rollback bug with extended query. (Yoshiyuki Asaba)
- Fix a bug with asynchronous query. (Yoshiyuki Asaba)
- Fix hint clause handling like /*REPLICATION*/ with extended
query. (Yoshiyuki Asaba)
- Fix crash of "DEALLOCATE ALL". (Yoshiyuki Asaba)
- Fix hang up when a backend node does immediate
shutdown. (Yoshiyuki Asaba)
- Fix hang up online recovery in high load. (Yoshiyuki Asaba)
- Fix hang up with extended query protocol when SELECT is
failed inside a transaction block. (Yoshiyuki Asaba)
** Master Slave
- Fix load balancing to work correctly. (Yoshiyuki Asaba)
- Fix crash if SET, PREPARE or DEALLOCATE is executed inside a
transaction block. (Yoshiyuki Asaba)
** Parallel query
- Fix INSERT failure. (Yoshiharu Mori)
- Fix syntax error when a query contains "AS" in FROM
clause. (sho)
- Fix Hung up when two or more statement was executed
in parallel mode (Yoshiharu Mori)
- Fix Query rewriting of Join Expression and DISTINCT ON
(Yoshiharu Mori)
===============================================================================
2.0 Series (2007/11/16 - 2007/11/21)
===============================================================================
2.0.1 (hikitsuboshi) 2007/11/21
* Version 2.0.1
* Fix process down with UPDATE or DELETE query.(Yoshiyuki Asaba)
* Send a syntax query only to a master node if master_slave is
true.(Yoshiyuki Asaba)
===============================================================================
2.0 (hikitsuboshi) 2007/11/16
* Version 2.0
__________________________________________________________________
* Incompatibility since pgpool-II 1.x
- the default value for ignore_leading_white_space is now
true(Yoshiyuki Asaba)
- replicate_strict is removed. The value is always
true(Yoshiyuki Asaba)
__________________________________________________________________
* General
- Allow to reload pgpool.conf(Yoshiyuki Asaba)
- The parser is now compatible with PostgreSQL 8.3(Yoshiyuki Asaba)
- Add new directive "failover_command" to specify command when
a node is detached(Yoshiyuki Asaba)
- Add new directive "client_idle_limit" to specify the time out since
the last command is arrived from a client(Tatsuo Ishii)
__________________________________________________________________
* Replication
- Always start a new transaction even if the query is not in
an explicit transaction to enhance the reliability of
replication(Yoshiyuki Asaba)
- Enhance the performance of replication for write
queries. Now the worst case is 1/2 compared with single DB
node regardless the number of DB nodes. Previous release
tends to degrade according to the number of DB
nodes(Yoshiyuki Asaba)
- Add "online recovery" which allows to add a DB node and sync
with other DB nodes without stopping the pgpool
server(Yoshiyuki Asaba)
- Abort a transaction if INSERT, UPDATE and DELETE reports
different number of result rows(Yoshiyuki Asaba)
x=# update t set a = a + 1;
ERROR: pgpool detected difference of the number of update tuples
HINT: check data consistency between master and other db node
- If the results from DB nodes do not match, select the
possible correct result by "decide by majority". Previous
release always trust the result of the master DB
node(Yoshiyuki Asaba)
- Allow load balance in V2 frontend/backend protocol(Yoshiyuki Asaba)
__________________________________________________________________
* Parallel query
- Allow "partial replication" to enhance the performance of
the parallel query(Yoshiharu Mori)
===============================================================================
1.3 Series (2007/10/23 - 2007/10/23)
===============================================================================
1.3 (sohiboshi) 2007/10/23
* Version 1.3
* Add new "authentication_timeout" directive, being the default
value is 60. (Yoshiyuki Asaba)
- Maximum time in seconds to complete client authentication.
* Reject a connection when startup packet length is greater than
10,000 byte. (Yoshiyuki Asaba)
* Fix invalid memory access when pgpool processed DEALLOCATE
statement. (Yoshiyuki Asaba)
* Fix hang up in load balance mode. (Yoshiyuki Asaba)
- This was introduced in V1.2.
* Fix segmentation fault in 64-bit environment when query cache
is enable. (Yoshiyuki Asaba)
===============================================================================
1.2 Series (2007/08/01 - 2007/09/28)
===============================================================================
1.2.1 (tomoboshi) 2007/09/28
* Version 1.2.1
* Fix deadlock while processing Parse message. (Yoshiyuki Asaba)
* Fix memory leak in reset_prepared_list(). (Yoshiyuki Asaba)
* Fix compile error on FreeBSD 4.11. (Yoshiyuki Asaba)
* SET, PREPARE and DEALLOCATE statements are replicated in
master/slave mode. (Yoshiyuki Asaba)
===============================================================================
1.2 (tomoboshi) 2007/08/01
* Version 1.2
* Add new "replicate_select" directive, being the default value
is false. (Yoshiyuki Asaba)
- If it is true, SELECT query is replicated. This behavior is
same as V3.2 or earlier.
* Improve signal handling. (Yoshiyuki Asaba)
- Occasionally, zombie processes were remained. Or processes
were unstable.
* Fix hang up when SELECT was error inside a transaction
block. The bug was introduced in V3.3. (Yoshiyuki Asaba)
* Fix PREPARE/EXECUTE handling in master slave mode. (Yoshiyuki Asaba)
* Fix "kind mismatch error" when deadlock error
* Fix hang up and SEGV in extended query protocol when a warning
SQL like "SELECT '\'';" executed. (Yoshiyuki Asaba)
* Fix hang up when postmaster did fast or immediate
shutdown. (Yoshiyuki Asaba)
* Fix memory leak when connection cache was full. (Yoshiyuki Asaba)
* Load balancing node is selected when a session
starts. (Yoshiyuki Asaba)
* Fix buffer overrun if connection_life_time was
set. (Yoshiyuki Asaba)
===============================================================================
1.1 Series (2007/5/25 - 2007/6/15)
===============================================================================
1.1.1 (amiboshi) 2007/6/15
* Version 1.1.1
* Fix "kind mismatch" bug when load_balance_mode is true
introduced in 1.1 (Yoshiyuki Asaba)
* Fix deadlock with extended query protocol(Yoshiyuki Asaba)
* Fix numerous bugs with protocol V2(Yoshiyuki Asaba)
===============================================================================
1.1 (amiboshi) 2007/5/25
* Version 1.1
* Support HBA authentication(Taiki Yamaguchi)
* Support log_connections(Taiki Yamaguchi)
* Support log_hostname(Taiki Yamaguchi)
* Show pgpool status in ps command(Taiki Yamaguchi)
* Fix compile error on MacOS X(Yoshiyuki Asaba)
* Allow load balancing with extended protocol(Yoshiyuki Asaba)
* Improve replication. SELECT nextval() and SELECT setval() are
now replicated. (Yoshiyuki Asaba)
* Change SELECT query is only sent to the master node. (Yoshiyuki Asaba)
- Use /*REPLICATION*/ comment to replicate a SELECT query.
* Fix unexpected failover error due to receiving an interrupt
signal while connecting to the backend. (Yoshiyuki Asaba)
* Add "pgpool.pam" file, for PAM configuration file, to be
installed under "$PREFIX/share/pgpool-II/". (Taiki Yamaguchi)
* Fix core dump when executing large SQL. (Yoshiyuki Asaba)
===============================================================================
1.0 Series (2006/09/08 - 2007/02/12)
===============================================================================
1.0.2 (suboshi) 2007/02/12
* Version 1.0.2
* Fix bug when executing large SQL to prevent pgpool goes into
infinite loop(Yoshiyuki Asaba)
* Fix bug with extended protocol handling(Yoshiyuki Asaba)
* Enhance log for failover and failback(Tatsuo Ishii)
* Add backend status info to show pool_status(Tatsuo Ishii)
* Fix UPDATE/DELETE returns wrong number of rows(Tatsuo Ishii)
* Fix configure fails to link libpq when used with older
version of gcc(Yoshiyuki Asaba)
* Fix DEALLOCATE treatment when used with PHP:PDO DBD-Pg(Yoshiyuki Asaba)
* Do not load balance SELECT FOR UPDATE, SELECT INTO and SELECT
with comments. This behavior is compatible with
pgpool-I(Yoshiyuki Asaba)
* Obtain path to libpq using pg_config. --with-pgsql will be
removed in next version(Yoshiyuki Asaba)
* When reusing connection pool, reconnect to backend if the
socket is broken(Yoshiyuki Asaba)
* Fix error with configure when used with PostgreSQL
7.4(Yoshiyuki Asaba)
===============================================================================
1.0.1 (suboshi) 2006/09/22
* Version 1.0.1
* This version fixes bugs including master/slave not being
working, deadlock problem in COPY FROM STDIN. Also documents
are improved.
===============================================================================
1.0 (suboshi) 2006/09/08
* Initial release
Local Variables:
mode: outline
End:
|