parallel restore

Started by Andrew Dunstanalmost 17 years ago18 messages
#1Andrew Dunstan
andrew@dunslane.net
1 attachment(s)

Latest patch is attached. Changed as discussed to issue TRUNCATE ...
ONLY when talking to servers >= 8.4 instead of plain TRUNCATE.

cheers

andrew

Attachments:

parallel_restore_15.patch.gzapplication/x-gzip; name=parallel_restore_15.patch.gzDownload
�i�wIparallel_restore_15.patch�\ms������
����CY���6�}��K���N-�8s{3��$���m�����.^R�7��=3��&	�.����.�����}���������^&&�t:����Ll��G{_����p�&a$^��,���-�a�%h�����w����L�Y(��x�2�K�I���;;��p2a]�u3���#����w�����<f�[[��������|��u���E*����2��K![�/��_>�V	A��i�����l��T@^l1��������5��P�"���><�o�/��������I����w�l7i�}���`~���[Oy��Z����|,�n2���L�@�����=-i�G�W����(����-�8�0�#��r�����Y>l�����\t�$������%�GX!�
����I�Y�����GK�#?OH|�s>�R�.|L���Y������=���r�B�kg�	��g<�s����Y�h��_
`�x�<� ;(|A�q\h�Q����,���1
�pW�4cY�8fz��-�_H	��?c���p�:����e�{��u����������L��=��B~W�31����j��*�Y8UX��0c���������WE�9����;LX����� (`�k8"�R�N���vW������o?��O���I��
f�`G�Z-Y�)l
y�.y��._�zl�_����"G(�<�8;=�����B���6p��<Y�6z�n�$(�����+�����3�o�d2���J���
6�����^��*�e|��,���Q@�3�N�$ �a����.��?'�T���|��@L`���
Z����������������>|{q<::T.=x{>�Sx�;��@a!�j{�6�O�b0@
���M`�l��^�*>���?�V�"Jb�p"��� T���,���-H��u�@�:��m��m�~���Y9���i��z<	�/���$f�����|j��-�x���
�yC��&��p��M����@6������I�$1��t���jk?I���Cd��#����W��&���m��������
�t�M;���z���_�����Y&�����G�����l�w/^x�����;����=��;����us�����m�1���W�+���wCVx�,�,Ad��y*�b�a`����gZ�����.�	��A*���mN�h��Q�}�~d�p�����c��������s'p��OR����%)@uw�W�������['���v�s�_���`�E^l��U�,_���a4��������zN�&r/O��nWd������aZk���p�~����	hY78��#|\��p��gGo�����hh���(����8�
$'�]�B���\�
y���6��9�I�+�0�Q�<&6)b�w���6�dZ�%$4�
P�n��Z�����P2�p�0S��MR6��.�/�F��=ZY�C� �*����)aVGdI���j*m������t�xED�bP�f�:%93J�J����t8���"[:�0��P�L������h��|���~G��i��M1:T6m���-�9��
�G7$8���V@r�E$Pf5�M0�]�&F���qA(F�$��qd9A9�UaQq����6����{�H �N��Z���s����9�\=h��l��!���k�>p���w���f��E�?�������_�.3���Nn�s�r8,D�qOm�9��A,n�������&Od��d2���Pr�c��X�N��&�
�v�E�H�[�Xs�`���� O�;v��Q�CU�d�����b���G��w���p�����Zy��OI�U�@t���b�����jL����R�D1=G(	���������t��wvR��3wN��6���c���0���f;~��p��$���m*��Y��^�����P�{cZ�t�I�4~m�Fo����F@�����o�o��� e��u��|pL/�Oh��0\1������a!�v������\{�{�����*j�&W����'��
�3F+�����x�#)����6�'��]V]����A��� �*�������0���C��=�XI*&8
�2��v��@V��Rb8����"� ��6t�+{[��ae(cr1o�Cd�%S~�^"`n�U4���n)�:s���I,��b�S<�ac����<�G�-�-|�93���-����������A�(j���u]��*[�2	oK�Y�/�!l�u�Y8��s����&v	�?X�i����d��:�7$Y�:K4!�������Ug;�L��i=:�:���OG�Q�����
�AS,���	��f4���y� N��H�<�!��P��?����E������T��q��~�FE��*�v]������JE��*����:�A�R,�x�%�u������%���{aQeJ�t����N�\����n�y^"O�;,a!.%����L�v0��O�����2�Y�u@�\!�������p��8�YP
PB�T�����&�02���o�;*Peg���e�a��:��z�T��3��BBL�����g���Q�
��9p��{vVc�����%��UW����zZH��������������5[�X��)�0�Nu[�k�<��eA���7oH���S*����b74�u�����2%U(Q ��'��!�K���,J��g����CZ������j1�XP�
������E2���x.C��\�!��T��FF�ct��g���^���a��
^��#=�A�H���]S�)�����(���~^��)��U}�*�����*i�f���m��b��5P'�<������/����g�x9��#�=CG���I�<"e���|j��t�����l0��@��< XT(8����<�/�<����H �l��t��&����;�q��0R�M5�J5�dv#��[	Q�#�r��"���]��
�������8������ Km�'}P	MV�<n��?1�'�r]����:�^;[��0�}�1v��KR_h������4��
<�� �i�(���T
{f��	��������|%���e^L&+^�b:�Q���2��bS��������������<�	A1��C��=��C8�V�0>/h��4��_���P
%�,��3��t&�P5?����V#s0���z�Ng��M�t��|{��.�r)!V����S�P�$E ���Kl��G�QNg�6n��������"P���0�: ����K�����C���:��v#9�	���k�k*d���������X��v]kte�o�q�;����x��=p��v@����titd}x������yqk9�_��)�/����J�/,�
a;4^^{UA
k~�����'7���-Y���i�l#�t]���`�rF1���ye��X�m�8�������n�T�e0H�vBRH�8������t]�0�_Qe�1���H�����m��A
��qE>�[��^=j����-������w��]� �U]\L��FI���?
X�)�7�������u��=��������FZX$&T����XI3�.4�a�C`���
7��e�e�:� @�K��Z�
D��f-�=~�����N��j��&s�Q�������DUz���%s�]T��y�
e;�����W�Y���������l�$�K����������a�J:�X�R{����2��2H�e�l�7CuD�3}��J���]c���W�����jDk��]����tt�~����MM�/�����=���:X�2,�FH��!�`��<I�PA�����$=H������1V��7�O��[��S���/����xW�,��F�,c�qb#�
4�P�
�^$��"�G{�Z���#�n�)c>Y�+��{\/t�-yzr��tx|�v�����������������:��9��ho������i�Y[��cV�+Vi.���R5����i�����StG�q�?C����Qt3�����/J2��������|�������.�c�4]&f��u{��lIr���&��H�\�=8|#Y�A,�E� Q���3���&4�Q����g�g6'�sYX�Q�a��%p�Wa����]�0���g�e����blB0��|���oB!+BS?tf�����`�����b�l�>����zk����5|�0agV��_����n�Ceg�����b=�hY�H����W�v�Y��&��V^��"������0�
`�:}CWvx��Mn�rX���15�����=����t�	��x����&=��_9P����.�/.ta�]�2N]5���cvq��hp������:� c�B��*i����VksR�T��y�1,���
U��ZVO?���R���
�nJ�M���f������Ks��I�oNE+�
<(��S-3��:eL����s��H��-Q_��r�x�Yn�V�a���f������
^[}K�S�_[�t�i"���+y��U����c���,��D�^��a���c�����������mh�Bo��T�e�n�P�63����(� �W/�����f}��r�j���H�00(�
�jKs:���jW���e��c�|�����
�P��8
���y!����#�y�A]a����A&tI���YRb$1sU��q���%P_�e�Bng�s����m3��Y��"K�4���*z�E�d�`������-5{@:���;����%����,O��������j
={m6A��&��&�e!���$�~�_�>�;(����i�]O�NN�����B�Z\�������&%f��.�<8�������p���&��t��D~��0	��T�K��Z����4%B��a�?QW`���=���4��*	/U�����;${e�?c��v*�������&��l�e�������hR���u|�kZ����M�Q�o������)L����i�0=Sy��'%2��_
����t1���H�������!�l�����p����������we���X��	�tX'������;�9Pe�L���������b`���TN���Q8Yx$�$Qd���ZQ��p��v�8PM�P�Ya
@���f,�8���	lT���UX��&��i&&#��(�FYT��������Ii���i����R=�VGd]t���.%�l�y�9�Nr�A�|��)�G>k7	�rPz������~�}]���q��U~�>�>z��@W5��:�{z�aA
&a������0�TK��\��#��#�W��	�3����^("w�5�E]�sz����Q�5�x��	��E���tX��Q����)f�-�#~?HLgPEn|Ld9��}�GH��;@����g����'�x�\&���1�laKca�#���[>c�ru����j�<uJo��)x�B�q����-m��tU�����6+&M	����
���O/��Yi�����
-�~A^M?���������Y���!�^F3[z~d�N�����0����k;�d���p���7o��8���rZ��!k�6[11F������2wN0i�p�+XM�K
�z*�U ��M�SH���s�9p�x�dS���
>�Z�!�8wt|��}^�d���:����[����c�_>~@�D��W���e�m�b���l0�88=��os�f�sV������������?�p|�Ym/��S���
3������4��4-{{p�����X�X���zt�$��S$�P$s�L���`Gi�;�1��Q!�����\�Dq��O�LH�0�}o���}��(��8��4�T�����T���� hI���-��,�>��FV!�R��o�qP���*��4%7fW!��k�r��]�H@�\9��o��I�?��|���z|`=�,�kD7�P5���/_�G����H��hs��%J�^{C�� ���nC��A�UM�&�W5��Ru4A7����fT��,x~�ag�7E�����at��J�
��*u�Ny1�4���R���=��)����H��E
_��[�j]��
����X�;3��!t`�I�������*3��������]����������<6fZ����Fn�)�����B��}Q������1e�<�`�%UV0�rW�1��@�:%�>�`i
��)+MS�n���`lIEb���=rP��_�[!���j%��X��V~#�o�MP���29��6�*�wL�[N����$������m�h���n/���!��@b��v{�\_���ht���As���S7�v?��f����A~ ���E!F���b���~������x+P�����>��'��x�����s,6*�a�xPb��]i��a����}hx�z�oK)�W������8�%��O�mo����������r�1�a���N�n7�:�<y;�K�h�;9���������r#�z�&�>�
���{~</���#!����G���H�(D�t-=���������BV�A.YC�����d������7n<��d��U��u,L������y 2,�[�(��������@��bA��\����yp��������B����c����-a'�����
����f{�E\���40��`I+�G4FR�x��Z��i"}����O��o��<�9�(��B�{���������`��a��mk��{��+��� R�����{�1b}�"&�X�&K�'��N
�
�����>�#��N9F�
%#JG�F�]AA+�E7�u��Q!h�	K�2Y3b�bQa�,s��cr��M�*�O��a�J�����.)Q�
���G�X%���	��)�^H�u��S������`�R�����)�,�\`�a����;b���t�L��c����������P��;G��)A�&�G��-�	p��Rcl��Y ��5��^�QQ�IWP#0���: a���s����,)Bh��
K

����RW�P<W.�����:�����5������<�����~%��-#���E*L������}��<c�,/��:1���*�j��#�W��!d=.�SV�"_��]�+�|*�J�VTjjDc�V<b��f����s�c�b=X��j.��}~�2g�bV�,�'��^������8k���^���~�8���Jo����8�� +5BE�%:����Fb����7�����!8���L\g�)&!�J�D`�����-�=FgCs�I�ZV������`e��,��D4* �h����k�X����[�,q�{��Ri�1T*����J�)}��Rv���*@/I*M�E�$h���������1L/��zQ���\��a��f���Y�����pI��Q��������O@)#` (���So��%��c��
-��� N���9�'���u7G?�]R���������}��s�v)C�A(j��n�U��6-�'��8q�M
4���,�"n��@�P<�wa��Jw�����������cpr*1�OM���r�q���:�
&����t���|�������v@�������09;mUl>N���I>g'`9��I��Kr�d���;������%]H^�`=��OC��Qn���{d�.��5'��JaW�S��[R�����'m��A�^�*�o��#g{���FReqE�����x3y�u������
��qi6\�e�*
�������/�AX����<�Z��;�]��Tz�=��I�J�&h�:$��,��\eoa���:xW�?��������������{z�^�a5�)�k�8��$�����*���HA"��IN���n����W�+�D��X�dKTh	�<��=&j��k��7�$c�!�=��	�q��=3�F��~���,����A�UU=��5�-��$'@r������	zW��<n5=�U._��J"6U��:������l���?�����o�[��=g��:A
��`��������im�3P�UU?2�o�}@���k��^Er��R�1��51Q�PJ./���9�$�����f��t|�d�����E�#'�������t�p��F�b����B���f�,���^8i>���-��:c��5��:$��)s��N���S+,�J��$�Dx��MI�M���)��M��	�K'�����R��6���=�O5����|�T��bs���	�m�|��W%������O����RJ�[=F������O�w�������jW�o�:�
���y��b0���2��f�2�D�&�q�,0T4��j���9e���`�[G\�A��Zk_�Gk���D����zf1��gJ�|l��4�9��*����O!��;}��6������r��� ������]I��kZ�������tH��s����,j��-��_z��������IU�S��b�KUH����i��['�9W�$"T��n_/���@���+?��~}r��\V����"��s��6�\��R���	���-�*9�J )���mp[��9AQ�y�,j)�+s^�99{s�q��?)�����^]fK)w*Jh=wsghpQ,��	��bsx{���m�-(1n�0?���vJ�����U��T�n���q�T��Nw���%�v+
G��6�4���7mH {���� 3����������B�����M��dD#���o`�����=|Yx[9��d)3n�L
8�������o���i��Y��8��$� Pxs�X0��o���f�c�Oxn)���/�Ij\U>��8����W+��AY�-�n��%10W�Q��������BN��v�����.eG����c���?0�T��Cy�-����_V������gF����t&<�frl������+��`�q-�4�5��BvM�2���)I��"�s���Uir_rF,��M����������2b�}`X��Y?��K���JdL7k2X��E���|���T	�2�Z�au�#S��S�@����sj&�R��[�K�+X�-q��O�������d�!-���m���|��o*�������a�m?d���A�f�\��������Bl�5��<N���S�����H��=�J�dH���
=@�=���n����I��������eY��/P(&yp�Oo��*cJ&8�c���8^!�O{As���i������X�����2n��zl�f�=���4\�a�{�]s]�a���n��g��;+�4
!V�h�����I�,�f�'!��f�^�4fR+��H��!�2VB>Q�n�V�������#��4��}/��Wf���"[eM��<�)[���	����K�����K��EEon��I�����������tG�&;��v��L{��8�t��emuy�c�v�*�gb�<�L��X�J�y}u#]rJ$Lt��
�e�sym4�`5�\�6_��������bf-zva�V^�U��mZfX���l�w�y����L���.a��o_���_��e��>i��X�������*���,?)���u�`�`�5��z�c@$�t�Qch}E1�4z�4T�L�(������k/��C�`�0I���,�]��p/��>�^Pf
��Q���N�^���������yir�^j�3l,p����o<�M�U�e2�����?
�b$���Vw��i[���;>}�Z���.!���"��q�����K��5r���E�e�-/�y��������#y�NO~1�V	+��cPO����Cp��
����w�*��������~�����F@��4�P[�
�/���8�M:(t���M�[[z&���%kN,m�e���e�M����*v]�:!���F�u]��Mw��\����������Y�\�,��3m���,9�w��,	���Y#�Xe2��hC��=����_R����9�q"�������K�n(�M�O$�@���Ihs��Vs!qL)�:���L���cs�F����q9��-��v��/����W��8��L���(�@�LP�s�a�/��+�|��PAl����k���&�)LQy��N����<�2�����R)J�P�Y*�\��un�$�\tJ��C��%���/r����k/d��:��
�|7'����.����z�����L,�^��}=bm�	�W�
���Q���rJ���~�>�1a�h9�$|^�����6���a9c{~��d_��������9��6��5�BP���	XK��ON�+8�1�1t���������2�����������Z��/�@T���������U�b_�b�bJn�����������UkA9�9�����E�����2<�8�7F�(��
������D

B�5��u��9�+x���N}��/��r�z�7/.W�{���{)*a�h�:��U[�	�)�\���V�^��{��_)[@^�n����������
�@>x����Ka�G�<F0�0k�`T�5���+�=�K�r�+���T�I�����k����A�:\r�Xev�����63j��Ix�-
��M2������iO`&���5x����A�S2�2��u���L���Oq����Qk��(N��;;����|��`�w�
��J�N*���?9��5�~u�n(��w���%����bO�c�[ul�_��S�76��df���l������"=o������R�u$���v����<D@!v�hj��E�*�����b!����!z�����B�y�W���-#By�a�E����L�d$��$���T�#]�7�}��!vK}�~T���(|yT�
��`I�����dP�1�����W�%#o!{���������?�|X`]�A��O�:������z}Y����w��b���hb�`<�7v�$�Y����Dg�a�p"�Tg;�r�P~�����`;�"8:h���R���b�J"��.�AT�d�Ua���L�*�RT�K\��^NF[�	���9eQ���sol�f4�d�S
v�}fM��Z+Hr�
|�V� �CT�D����K]�R����T�������m��0t���;����#k/M{*����f�{<��^�w����o�R�t�MLe����)��~zx��z�@���3�Wo/�.�C��8&�	�����c�[ 5���'���N���W��/��"��3��f�N�?>}[�y��22u��l��"�1�\�������M��9���N����%�Y�U
|*W`*�J\YV�s��v{V����;�MG^>n}V3)0lV�}�i��m��C��c�a�3�MA�naP����C]�Eji����7��B���[���Z�y�k|o��D+bF
-���U�:p.�%�����Yf��=�k����f'��V:M�ux;�t��LF]�
���; dL\>�Mf�j����k�n��dx$��S��� ���J�aL����n�Z5�*<��uu�{��R%(V�E��O�E�o~���3����G���A��3����q�%�O>G��]��������n��Wj	��7��o���ZcG/?n�?�g���Ry?��8�k�j~�u��M�R���{��X�O�Q�������
_V����i��|^P���'W��O"**"�v�x2G�O�dY��(�-BvT�h���5��K}0��`�n�7��ik�����]�"�7�O�F!����wQ�{<�������!�_P4�g+ \e>�TKA-2q{�kbkKl�r�E����������D%��j�	ic��\�]�Zn�����~�)FRX7T�����{���3��N��B��3z�J%�/��Py�k�wW����ff�#��2&�
:�D���4[��������0�g8��AS��5z�%(>9}��&��n�/�����T����	�8��'�S{��e��I���l�H%���[��-N0�e����m^��@2q\�����Y�[�^EA��:�0��m��@@�Z���j>�M'��Bggtv3���^���f�/�l��Mmr���9d��?��@������(�B�����KEV1D���iN��{���\K�����`�(���A�Lc������{8����O���BynGzj��Y*M��<���!�_��E�|�!c[	�����:���P������E�Nt�������M��-C�D�$S���V,Q\��%������r��Qw8���qe&���K���m��Wa��9���D���L�w����m.T�XB>_�0��P%�QTX�
�J���{�[�B3���f���=��#ch��<�:�q���6����._i1���c������7\��"�����$���.9 fq@6+��X��b����%�9�0�9s����2���3z<��>
�9}'�L�M� #����Q�%72l�a�.��&�`[�Y~v�*D�G�����3 5|�,��&�[5���2X]���"�?���b�n8WXt>�<�r���^���:�����N�~J��HXC�b�Cel��M���p�[[��Z��D6����8D[��ca�(�
:8�)x��+['�T���Lm�Q����;��2���
���b�l��@"��=���I�#�k[^��]OE�>d�Eq�T��{�;��3>K���f�v�71�	��
�taC|��n��j�@f���F�$�GT}����d�k�h������mz$����X �����b��A?����L"�Q�[*��3�2?��6?�n�3>�� f����m�YW)��Z	�����X])5����>��kT��KY������5)\�$^�]����{����tt�y���s+��}�.�A����%�M���[oz��������4������<8O���I��@N�$�<������|��l�����MJ�?z���">HGiw���O�����t�1�g������s�d�e{�}3��]�a�wg*XNAAj����#D���
g$|���2��Q�A�Z���&w���!����[���Q������+�}�-yw��t�}��������6%�����9`�2=��\��x�nBQ�����,f�K�f� *������CL8���q���X���6��[��?����^���kN>C���7�)r����#3���W�G��N9q�P���0�����a�a .��8�=bJ~[��F��MpCu!��{��vw}!!�V~i[Xg�	��t�.mod36�������3��M����a�?-bX���s�8A��`
N8�������e����L���'D���we�������.eW�c�!�9������=M�6V��j�SE�{,\&(������T�)�=�H���>�
O��\
\��0��:�{�����E�rkA�u]�N)������w�S$e~	6uJ�?���,:��t�Q=��G�~�����?��@��?���9�������a*�>���RP���CU�Z�:���Gv^��m��d�����g��3�ecu�+�e80�45 �R{����R����2����C�}@�����P�6��=����z)��m�h�c�n��B��p7���n��M5n����%s�5o&Q�q��"��a�~a�EL�b���<�wJ,c�nz�F��pI�����\�r}A��xT�]j���VE�&=���}�&T:L��&hL�*0�O�U�1���������bYl1�i:���h�0��sh�E��,�C�z���8;Gg�����������^����j�P��^(T�A�&��+�����q�=�~�(ZP^�H�
�j�����h��M���'v�0a&7����z0���c�";�
�#�Ch�U�]*UJ���
�����u������ta'�q�X~L54��Bw�:�w���^M��U�p�<
`O�T�����k��(4���R�yS+�$�2�U���K�}�������xG���0^|�f^L�:1�1��Z�q
��q7L�L�����4c���@Ht'�j��,�vr#}6��-� 4�Pw.!�6/B$�9�{���n�l��}�J�&WE��u@D������������
aKB����|�}TN�q���qKmHrB�
��#�g�>3�6t`	G3A�^>����+��%��h����5h��a�u��@8��n�s3�"��\uM�Unj����if�GraYLo�6\�pT��eb��31cK����\c����\m�<m���x��~��u����6��aj�T�m�����b����H��&[��a�C���B����ZV��dia!lWk��XU�Fu�Q�A:��:�v�v��W�A���8Ww�e��2��I�x��a�`�n�r�E��Y��k������"I&sI���0���#3�A|�Ki+U,��V ��9�/�r��`}�X|��
� �
�*�E
_9��:��jEZ���d�p���������"�����w��c0h�8c��J�@vuc[R9�@:�_���7��*"�����9�����Z����,
|*�%��z.;���Z/Ox�t\������n��Q)���S��f����i���)8m�5Z���w�7Pt��T�:I����S���������|_��&C%��pt��`�k:W�EG�oA�U��z����c�b������^!_3[�5�,��V+&����t�����,�
���A���j�����t��:}�k��k9��;=%�����adN�r�L�r$�����L.,��+9-�x7�����=-��e��q��IQ��_���[��a)��<N�� ,5o�yS���%���3��9K��N���;c��\X��'*��r����3��j��|��l����J�oELd������������}��)H� �l4��"OiIu�F�jN=�"Q����^��krn��u9���!}Qt�F�|&y~�g�K�
�L.2[����H���O7�lW�.�!�.A<!�o+A�iJL�T��@�z1v"?�)0��m�@��Q�H���O��z�6�I��@���HX)Cn�
3��F���[7�U�yn�:O��-���us��@f/:4P���`� 8,�D�b�Z���T�B6�7���{���nT;�D���7����P|��dp�V�L3�z��R�Z��>��S���=��p��O���*8X���g���
`D�j���A�9��t��>�EU�F�(�Xn��:�>�F�
[-��@���xZ:�J�
K�0�R���%+�H�u�������
"��AaJ�3��q:}VZ�F	9�`�/�C��B�x�d�U0��������	�)��mQ��6�!s��_1��l����+/lFo��Eq�7�fcJq����A^��*�����;�-��+g]tK�X�B$������B�
����t����hbZ�����Q.KzW"�E/�f&M��i����:.����9�IH�B�������l����������R���V�O�h�,9�Za�*�o��1���G�%!���� ����%oA�S�0[�6(���&�N��j���N]S!	��N?�� ���+�v��-/���U���
���M?������t&m�s�V��ZXt�R��0!�<Jl�z:!����u[A�j�j�����<F���+�W7���Vu�/O[z��|��([.��@~�]{�j��9��_��Qw�m�[�����-
]S���
u�����J5(���#e��"�V���l\+�R!zz��={p|���-B�����5�}S�-Uk��	�����8(7S�����8��[wol9^
|��!�9�?�OND��);�8���T.�	����
p���A��xk������������W�=����[��u�y�w�I�If��Nz~qvX����D����p��nr@�Rf���b�9�s����i6��c �s�es����f������*���W���4�:�%���SDAr���9�:KI	\IBXt����p�:��0{�W�@~Tf��fc<q����-pg��U@�����k���y�.��|Q���p��n,�q�,qP�f������0������J���9���*�����s���/��.�*�Q�@'F8�*aE��:�s�����.�}���8���G
���"&��aB�\^.H����K�]B[hK	�?��Q=�{�	��<��q�����������'�,H��e11����c��S
�6pW��z���T�G��s���Fl�,���B���_���$V��0���T�Jh����sA�
�����������+�P}z�t�/�DJ�uf�����;�Z��������3D�V����#`�x
�xy�Z
%��NfD1�W�2U������������������6�� �!vG7�
������~W�����R�V��@����ns5K�m�58V�#2.S
�r��|��*%����_�Uxb}��qE���Z��8_���br\����,�*$���'F8�	$��4N6<=�+�9�
t/����yXvi�����&�v�l���2�� ���uDg\	��|&��p-���`���9"	x�-t��C��9��d�(t��y�k�l��F���E���)�Z�����|A���3�:� �HB�*���zU����\_+.H��h��G�8_���/���h�-�AN�b��xp�"����b�j$!�:��s�7���rYN�$���dS����s�0B|���r_���j�YK�q�m���Y���������,����;��w�����������y�k��k]�������xu��&��~�r?Q�=<����e�TH�|�`���Ip���2p��d.��?���9�t���?��u�����{�q��������#��zy�I|W�\f��Q��[��y�.�'=>}{����O��U���e����
Ji������P�|��i�[�C7��c��n���i���{����,�@T�r���\���D�J���������Dk����k���������L�������|/�Ta ?*O�� ����k�Kg0���57Tn��#(���NO�y)��/�d��E(����C����tP���\�\��kox���jQ�X3>��Q%����>'~�������t!���+�NW���f�*�_�A��%k���G$z��UV�w�s�r�W����z��bie�x$��*3�J��r�t��	��,��~�4O����X^���?a4�B���k�H���BH�VN2���b�Z2:�${<+��.sq���'ZJR����>�O���lG�7]�j
�
,��DB�����yfdp����H���MN�YYD
9�����[�����J���F&�����+�
�4'p`���Z��?�@����s�	�BI��A��2�P�U~��{�+����j���Z�=B��#<Y����w���j1y&&������H���������[��z?�+1�{��C�a���	�k����}s:�v�_.�����R����
F����L�Tn��U��1d���N:�Z(����'6��6�oX�
���M�-���g���L
�x����5����m_���j�lB�E��?|	�S@�M����c{��O��=���{w����CE
7�0�'~���������I��=vz��<�h�f��s8������X�&��T�B����2����`8���z[��m3���fi�v������������n�l�{�{1����^�~������wC^�[�)�����UYwBV�e|��@[�m�8=�L��T������o�8�X���T�j�|��w^O�#��p������g�(Q�aL�$YgW�#�N������z����3�Ec2��� 1w��V~��!0�Mfc�����Ko�����T�p$�i�����)
�
���4 �u
2{d>�E�ZU����]aW	u9�+Q�bc~G� �;T����ai����Y|�������hWu,U?qqvR�E��JDU��=olz��3J�E
��b�q0��Q��n�����\�G(P���<�4�>z���:�0�����
W�D/�.aN'���x�><�������O'���+����Aq������|��Zk�vz�!U��Gs�P���n|�Er�z�Q�?nP~P,�<�6&]((�	���-t�8t��R�C�Z��1�FE%-a*���q����KQ2Z�z`��J�q9��k����j8���������RsuAK��9WE�yw�Us�v��Y+1/��� f	�T����M!v�yW�����u����RPjA>�cipN'����X����O������
�.������p�T� ��V����i��M��C�.:��IGP�����Q���8O��~x/hT������m1�1Lq}�}�����4�3��RA��)?���=�A�Z�`��yuh@ uLA���aF���eg�G�p��h�������y�I
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#1)
Re: parallel restore

Andrew Dunstan <andrew@dunslane.net> writes:

Latest patch is attached.

Starting to look at this now. One thing that is bothering me is that
if the connection parameters are such as to cause prompts for passwords,
it's going to be broken beyond usability (multiple threads all trying
to read the terminal at once). Is there anything we can do about that?
If not, we've at least got to warn people to avoid it in the manual.

Also, how does this interact with single_txn mode? I suspect that's
just not very sane at all and we should forbid the combination.

regards, tom lane

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#2)
Re: parallel restore

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Latest patch is attached.

Starting to look at this now.

Excellent!

One thing that is bothering me is that
if the connection parameters are such as to cause prompts for passwords,
it's going to be broken beyond usability (multiple threads all trying
to read the terminal at once). Is there anything we can do about that?
If not, we've at least got to warn people to avoid it in the manual.

I thought I had put in changes to cache the password, so you shouldn't
get multiple prompts. That's one reason that we make sure we connect in
the main thread before we ever fork/spawn children.

Also, how does this interact with single_txn mode? I suspect that's
just not very sane at all and we should forbid the combination.

Yes. I thought I had done that too, will check.

cheers

andrew

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#3)
Re: parallel restore

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

One thing that is bothering me is that
if the connection parameters are such as to cause prompts for passwords,
it's going to be broken beyond usability (multiple threads all trying
to read the terminal at once). Is there anything we can do about that?

I thought I had put in changes to cache the password, so you shouldn't
get multiple prompts.

Ah, you can tell I hadn't gotten to the bottom of the patch yet ;-).
Still, that's not a 100% solution because of the cases where we use
reconnections to change user IDs --- the required password would
(usually) vary. It might be sufficient to forbid that case with
parallel restore, though; I think it's mostly a legacy thing anyway.

Also, how does this interact with single_txn mode?

Yes. I thought I had done that too, will check.

Yeah, found that too.

regards, tom lane

#5Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#4)
Re: parallel restore

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

One thing that is bothering me is that
if the connection parameters are such as to cause prompts for passwords,
it's going to be broken beyond usability (multiple threads all trying
to read the terminal at once). Is there anything we can do about that?

I thought I had put in changes to cache the password, so you shouldn't
get multiple prompts.

Ah, you can tell I hadn't gotten to the bottom of the patch yet ;-).
Still, that's not a 100% solution because of the cases where we use
reconnections to change user IDs --- the required password would
(usually) vary. It might be sufficient to forbid that case with
parallel restore, though; I think it's mostly a legacy thing anyway.

I didn't know such a thing even existed. What causes it to happen? I
agree it should be forbidden.

cheers

andrew

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#5)
Re: parallel restore

Okay, another question --- there are two places in pg_backup_custom.c
where the patch #ifdef's out hasSeek tests on WIN32. Why is that?
If checkSeek() is wrong on Windows, wouldn't it be better to fix it?

regards, tom lane

#7Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#6)
Re: parallel restore

Tom Lane wrote:

Okay, another question --- there are two places in pg_backup_custom.c
where the patch #ifdef's out hasSeek tests on WIN32. Why is that?
If checkSeek() is wrong on Windows, wouldn't it be better to fix it?

Oh, dear. That's a hangover from before that got fixed earlier this
month. checkSeek() should now work. I will make sure it does and let you
know.

cheers

andrew

#8Andrew Dunstan
andrew@dunslane.net
In reply to: Andrew Dunstan (#7)
1 attachment(s)
Re: parallel restore

Andrew Dunstan wrote:

Tom Lane wrote:

Okay, another question --- there are two places in pg_backup_custom.c
where the patch #ifdef's out hasSeek tests on WIN32. Why is that?
If checkSeek() is wrong on Windows, wouldn't it be better to fix it?

Oh, dear. That's a hangover from before that got fixed earlier this
month. checkSeek() should now work. I will make sure it does and let
you know.

Here is a new patch.

Changes:

* above #ifdefs removed
* fixed declaration of DeClone()
* brought up to date with CVS.

successfully tested on Windows.

cheers

andrew

Attachments:

parallel_restore_16.patch.gzapplication/x-gzip; name=parallel_restore_16.patch.gzDownload
�q�Iparallel_restore_16.patch�\ms������
����CYV��ib��������Z�q��f4	I�)�!H�:m���]��(;nzo{f��M,�]�g�]@9�q������?�G�LLz�t�	�'���g���������M�H�d�Y2=�Z��,K2���OQ�>;��G���P\���e�����7wv�d��>�f���G���q�0[��?y��lm}���_>�~��9�n�O�Tt���e<�;B��|������6�?d���'�hAP=x�����#�~v{�<�B��8�������xl�"���&i������L��G���ro=��h����������2���s:������	^��;/�<�2���t�x�\8��.�u>��"f�L�y"s��s���Xs�h�K�La��7d~��&�_d�*�-���<!����K���1��of�?cF*�����q�	P��'hR��0��&s�g!4��3|)�9�y��(Z����i�q�%Fg�"[��gS�4�]�Rd��eE����Z�4K|!%8��,���3����������������6zO|���/2���x�
�]�����������(g�Ta)��8��b���c�_����
F�0a%�n�� ����Hu��;�$#����3_����'�^���3��v�`fvT���E����G���g���U����K�<-r��������zh($
�?l7���el����I���Q~�����>S�6J&#�o�n���`#.y���U��Y�L��\$8S��H�b�J���B��srJ%�1����P�����58>����������{��������A�������!=����\��[����[a��(#�@l�i�6�&��5���w^����(������Pix~H�P�� 5f�I�������q�����d�<J�� ���c�	�$���Gk��P��3�����>����Z6��
���Xd��f7a>;��3��jO&q�� K�A>����$]��J=T��J��2>�_u�#�l"��yFr{jj7��A6��R{�����c���f��_�Nv@�����M�q�=��w�z�<��/,z��w�����_Gc��VcRCk��Wl�!� ���"2�Y�Y��p��T� �2�(7�����1�]���T�]���$�06�������������}�������_!��5�N*�4l��:A��r{������;Y�+����������P�x;���������@��"/	6g�*~�/�B�0�J|Wq��\='a���gO�Td������aZk���p�~����	hY78��#|\��p��gGo�����hh���(����8�
$'�]�B���\�
y���6��9�I�+�0�Q�<&6)b�w���6�dZ�%$4�
P�n��Z�����P2�p�0S��MR6��.�/�F��=ZY�C� �*����)aVGdI���j*m������t�xED�bP�f�:%93J�J����t8���"[:�0��P�L������h��|���~G��i��M1:T6m����X2&s�7,�n2HpFs9���<	�H��j4�`x��#L�O	�+��P�fI����r�r��������m	2<�����@(0�Q��Ya��#&@ios6�z�(Q��C*�)��}�J5�.qU��_�@0�_�l]f<2`7������p&X2�������s~%.-�X��	�7	�SM���w�d8O#����4�����M��8���X��R��0�`�9��@��w��9�`��&��'l����8�Y��6|�������������L����H��(K�nK����������bz�PD��e-
�%��0������g���?Nm@������a8W�v��� �^[I:�[�T~�
6m�Zem}O�����6����* �h������/��u��l��������9;�A���������^���Noa�b���	[��"BR�8�QS�O�����e��ZU�|M�d�q�O
��1g�V��k����GR��!@	$�m�3N:���L�����_A�UZ���}�n������{H��T*Lp�#d���r���F���p�+OE>�A0�m�,W���k��P��b�4���6�K��&64��D��.�hf���Rhu��Ac	�X4����x�������y���[v1Z��sf8�[�#���Kc���Q  �"�C!���U�,e��"#�8_�C�\���p�#<�wM8�����4�����7�uRo4H�vu�hBT)I1����v��C�zt�/tL��+��(��w����(�X�?��h&>!,��A��1���x*JC�O��k]����1X����2��>����	Tt�*���SQeA����)Ttm%u����:X�K6��Cog�K@5,S!��.���`��K�1�����
<Ug�?��D�0�wX�B\JTi-G���"`�9��+�K�e������B����KIc���q���:���%��	���9Ladw�@wT����[��`��Mu.�����g$����j��	��0���6p�s�-�����t7�1>SK4S���w�������'+3�M�/?hk�*�TS|az� �>���<,yD�����wo��.��T$���nh���7+�9eJ�P�@��O�C�f3�Y�Lq���u����M���b���F/:J�-��dRy��\�J���C�#����N���E3�80cd���W�#0���Gz������;&���R}�%:5Q��?���{Sz���>�U��]/�'hU�`�`Z%%���F�k�N�yv���_F����@�r��G{��@�-�,xD(�D������������`F1�;�X/:y@��P
p����y_�y����@���o�XKM�m��w����a�4�j0�j��>�F|�7��6tG,��
�E������lO�c5��q���/��7@��O����Jy���bO6��<��+�Su��v�h�a���$b������t��%c� h��x�
A(��/P(Ea���f�@�C#o����<J,������LV ���t`�6�=�	d�[	������#�A[s5-�+�
�xt�b���-z�	�p��2a,|^�23Ni�1�l�e�JY�g��L��j~����F�`\�	�0����&�7���d
]4(��RB�()l�5�%����1H�@&x����5�
��,���m���;�M"?	oE��A�a�u@���C���US=�����mu:H�F r0T����&p�T��o�)���S�w�LK���<����j�
w�!tU�j1 {�����=�����"�����7��4J���r���
zS�_*�����_X��vh.�������N=�m��'Nn4;W[��W��*�F������'�D��bL����`�#�d9��q��)a�-P�H
�!�`�������q&O��
o���a����4�>c��dA���k�������0|r����z� �yY[>w)�y{��(��.Ar����$�u��$5���S�o*����/��2{�E��gGK���HL�t3�m9���f�]h�������?nT���uA������N�bu�Z"��M��mt��W�l7��������%��s�D.����"�~���n(�YmUo�R�.���e$f��� ��\Z�W��V��h4h�P/�W��2���������Ab,��pd����#�����U�T��K���Z���VU#Z�_��4�5��;�K��<�ehj��i,&0�F�������a�4B���^���Iz�
�5�V=� �A�M���p�e��:g��q�}��l����|	������5`)D5Rf��l��1x�JW@�"�,Q<����	v3�L���^���7�B�����'��O��Gm�	n�K|>�
���H��������*��z�������?fE�b���mpZ�!U#Yy��?�<EwT��3t]|�E�0���[^���$�_��-�Y�L��M�;�����b<�1K�`b��]������$W��k���t�����7�uq�B]���N:S��`Be���y�q�`s:����XYGP`y��/<��3��x�\V�!�H,�&C)�g	0�&�� 4�Cg&��)X`8��, �+���C��O���X|X�W�vf5���iL��?Tv��i*�S��u������zU*`��u�j�8�o���},r����-x9S� ��7te�����,��YS;�����=@	yN�z� ������qn�p-��
>a��r��B���,��Uc@�z}�.�
_�t�Q�d�VHW%
Z�^�jmN��
s4�:����S���_�����1_*�y�S�@[�MI��Y��,��:Y�~i�V;����h�W��"�[xc�e��9X����\��{���s�%��U��1�����4�����LR�\��U��k�oIt���bK�N<M���}e"��c�j��~l8�r��;"�h����=,���y�677��U�Z�bB_�
MTh������[b����
�f�"��q_����w���/[W�Z�R�	�S�UmiN����P����u����v����Z�r"��J7Ga3�>/����v�?�8��+��=�2���"�;�<K
@�$�b�����#n���+���A���un�4�mFQ?��[d���R@��L���p�����`H'~vy'~6��d���!����1����}�\���c��&���$�D�L �Z�$�O�+��tE�sZ>���������rwZ(�R���� �#t������C[�e�������<>��>�$�������a{&���vI����j��.M���aX�O�m8}�5��B.
��B�J�Kf���D�	�^�@����2�����<�.���	+*�e20����3� ��G��|z��EgT�[?�vk�"|
�x��uZ=C�T���q����W&�;�1]�D#���1���imE�:��1�8��/\>*/����ew�]�cu.�2�j�����~��d�NeT�3S`�e�<�.��X�p/��*xN�$IT��k�V�7+\&�]/T"�xFXPz%�K'��/j���AV��	�g���r$��Q�Eb�#��"�krRD���h�d �TO���Y����KI$`�lN�#���\j%_�2v������
@�����h������_v_���g\jh�������2�UM��N���~XP�IF�%�ao&(+�R�#l��n�H�����kB��& �����qMmQ����%��gTv
%��f2q���+V���.B�/r����D�B�����T��Y�5x�������c��Y}�e��3�2W�I� j#[���X��H&�����X�\a��D.���+O����u
���e\��teK[%0]�����~k����IS#C4��Cs1���Kj��.-�}�������/�����<��V�5���6�4=$��hfK����)�����tp��Scm��,�Qn�Y���&��2g�QZN+P9d��f+&�H�\��<]��	&��s��|��\B���jD�Y�	v
���}.4'.��l*�Q�GP@�9������������^�Tg5��}`k�v�sl���h\����az���-T���
��gC}�m��u�j���{��>�������/>���;{j���af0����&�A���eo�A����]����_VP����=1b���d�)Z��(��`>���[?*$������(N����	��#��
�Q�Opa�������
�p!�q�����-i|���e!��e���H�*�Z
w���
=�X>R�������*�Xa�R.1���O	(�+'�
�"=)��{�O|�ZB���g�p��&��8����B������m���DI#�koH�D��m�39H�����d����Z��&�&��s��J}���1l��r ��h����;��BUW)PA^^�n#��)/���&��[j���{��6�e?����;yk�5���X8�` ������-X���dLr��_WU/�3=��7�c43���tuuu-��=�h�O�w����P���V
���E�N"�c���i�D�}�TY��]Ac<0&y�&uJ�7�'��v@SV����3�
�����
��wag�*�h?��B�?�J���<��B���t�;er�?f
<C���1�o:!*z���4�[����1�����������c�u:#�����D�n�M������t���67�L
�Y��.
1"��#����^�$�������p�F���?1����M_����c�Qq
�������J���
��
<��C�s�+|[J�p�b�N�/�9-��X� x�M�xe>�w���������e�u
v��������\Z����%n����u�����4���l�}��^����y��	1?��?���D�O!��k�itJn���u���r�I���''+���� �_�S�q��h%��W5���05s`8����X��o�����N���~����sI�����e�N^����'�u/P�%���2����_�J�7�f���=�=qm��s���PdK�%-�t�OH���"jEGs����V2�<�"��$���`���
���_�s�GWv��AP�e���u���@�$��H	Z��7�=���U��b)�,Ar����)v)8/ 3:�W��t� :�US4��)i�w1�(�4�q�F��',}|�d��uN�E��3��I����J0�6��d>k��+u�kH��{�D�*0@���c�,�L�NI�\R��D���t<m�[����:�k��Ts�M�������in��m3=���jf4c�rs�C�b<� �����v���&��J��5���f�H��`V{aGE	$]A���r���E+F;���!YYR��D[���_�����x�\N���*^�u@=����+�����{y��I�7�J�G[F��5�8T�*�����T�yb�,/��:1���*�j��#�W��!d=.�SV�"_��]�K�|*�J�VTjjDc�V<b��f����s�c�b=X�[j.��=~�2g�bV�,�'��^����������R��r���h�y��j�p�7�\z9�� +5BE�-�����Fb�����������Qmp&�3���G%h"�l�T�g_-�=FgCs�I�ZV������`e��,��D4* �h����+�X����[�,q�{��Ri�1T*����J�)}��Rv���*@/I*M�E�$h���������1L/��zQ���\��a��f���Y�����pI��Ql���~����0����7��~�5�����c�?'�D�����N�����ob������6��y$��u����=��{����(�|t�M���	�4Nj���{)�;���NW/P&��]����t�c�k��w�����JC�S�>���/B������I�+?9��c#�+qb����o��+�8������i�b�8���&�������'EJ.���qsw;��#)�-oK�����z����$���0��w�P=�EkM�A����H=\�,�,�ey�L:���2��Uv��
���:�s�����\GI��f�����=:���c<����l�.��U�kM��M�_��X��y"j��+w(r�����������@M,��uHR	Y�5�����sq���q~�G��G�8:yK!�a=�G%J��z�����`�WJA�&a�e��V�^$G
!�%Hr�������h��R=� *����$[�BKp����1Q���X{������`� �'8��s��lB)R��C��g�����l��������/!�&�8����������%��q���9�r�����V��J�����hgdCw���d���`S�����9���	�P�����
X�F����Oh�������1}{�2'\�|�*�������������Rry�p('��%�N�M\4KW���H%��p{{0D/�m9A�)nf�l����+572��&�Z�G7{iU���I��p|�o��&x�O���8�q{;=;<�N���+	�� ���6$�6����8 �/\4��&$/�4�>H�s|���{b�j40�<�������,$��;bc���	�m�|��W%������G����RJ���#��f}K�'���~�����jW�o^:�
���y��b0�z�"��f�2�D�&�q�,0T4��r���9e���`�[G\�A��Z�@�Gk���D����zf1��gJ�|h��4�9��*���L!��;}��6������r
��z ��:���]I��kZ�������tH��s����$j��-��/<R
�l�JPV������T`���*$[A��4�����)y�[}���Yt��h����l\�����b�H������t����`�(5���J���H���h���hNPTn���ZJ������O__x\?�O���w�'��R����Z�����A��cB-���\��onJ�����kq��n6E�3�+�r)����8>�������<��a��n���u�&�f2���	dO�y��d&�5�C�Qx��[�������	���h$7�#��
�U���������s:&K�q[�`j�����t8]x;8��L����/����'���������y�&��0�`�sH��~yOR�B��7�f�����X����Z��h�w3',�����{�����]`�/�rj���3x����t�0(;�4�����?��S����7���?����4-��pw83:����3��6�c����6 �^1�c���k�������k��0f��NIZM�� ��ng�J��+g�����Y*M
N{��-#&���,���j�T�AX�F�t�&��
�Q�k��g�)��A���VaB����>E��2P������	�Tg��F���
uK�������>t�!Y`�A�.�y���c������e�D p�z�r�����l�G�>�10����,�[|N�.�7/��$�KWf�B���P%q2$Q�]���M��e���j������tv|]s��,D��(�<8
����^�H�1%���G�y�����9�g�4s`E�f^,�|�mK7�b=�M3�n�D���	�=�����0�FM7��3j��m��+Y4��Ki��i�t3���uX3U/K3��n|����R+!��J7i+s��������z�XK�N����K3	�XM��2��xw���-R���h�����THt��j���77g����E��
q�qZ��V:�#m���a;�b���YI��������1Q;C�31ed�S}�n������.9%&:FI�������I��u.O������k��k�c1�=��U+�l����6-3�EMZ���������o&R�h��f��/a�������@�4e�,o��k�Hze|m�������Y0o0�NW=�1 �u���9����E�t�*��u�xj�T�J����
 X0P�$F�q��MF���i��U/(�m��V�O��r�sC����g����
��F/5��8K�S�5�cScD}�-���f�����Iw:
�^O;�u������/w�>�����
��,�]B���c|�'j/J�������_��?9���=������o���*<��I��7:��]��y�B_�_���7p�U6�<���Pei���P�T(�oo'6p�tP�t����7�L�3���9��i�q�2�]6�V0�����uM��,X��k-o�u��6��r!�nj�����'g�s=���r��������P��z�$��F`g���*�`GZ���Q����B������!�������\��2���D�$y������6WI
`5�������a��I=6�m��x)���}�"xoaW=���_a��}�;�������E���	�|n�a0L�=y����*�
��Uq��?:�<�)*o���	X�;�FR������_.�A�j7K���8�������N�9q@:�DQK�eBn���r���l�T�����������E�\�T�T����e�+���G��8�"���^A�:�"xTN	p�����=&��-�����s��?�����RX	��=?y|2��I�I�B�qR����~���Z!(����T
�������p�cc�:���%-���e�?}W�gO�i�7�BoOp��:�K))��y/����|k�bJn�����������U	�A%*qd�Yu�,wM�ex�p~o�aQx.�	�96�'$��|k�8 
\s�W�������M_������o^"\�$"�r9�T
�rT�r�Lux�����S�P���*����6($.�R���N�<���?k����n�|���������y�`�a����:j|s�W({��$�(�T��u�X�$�Q P-�R�N)��u��4���L%e{�mf�$=���[���O4�`J�FSt�}������A�������@�Qw*3m�z[<��vkgD�q��8�f��������-�b9���"�0T���'9��5�~u�n(��w���%����bO�c�[ul����/6��df���l������"=o������R�u$���v����<D@!v�hj��E�*�����b!���YC���#7��|}O�����F��@�^�\��%V�P!�H�IRS��G��o���C���4�����Q��"���4��Qwc���Ls�	[.�cJF�B��+%w~S������&]�A��O7����h4���h\jY��;�j���R��z�x+>�V�p[dk��I�	f�-��S�m��@Qh�~��@���4����NcJ�>�d�*���R�QE��W�5�VbZPT���j��5��O��d���zo�Su�h01�b��0�i7��R���3k��zA��^���V(Q�:�*�$��%]�J��@���%�Wm�g������g�P������Y{�x�W����5�������
�+>41�|����`��lb*�?LiT����7�sr�����|sqy.J���0�L�'�'
�����)|o�81�?�ub�%�z�(}I�Ig�9N7�u��������t���{��f���f�������W�%=o���9��v�~�T.��J�Z�S�
S�^���������[�2�N�6��l:��Q���I�a�B�	L��n����.C���o
�t�J��O��"mRK3�o6���2^]p�J������_�{��%Z3Rh����R��s	/1���@��2����]����5;Q�G��i����a�{�g2�J8����9 c��	mb0�p TC��<�~s|�Q%c�#�����p>�tWRc����t���9P�q����[���A�Z)�}|(�!X�sF	8�T��\�U5��/��I\g]���sd	���{��x�zy��TK(��n�~����;~�������\(����������m��+������E�||&A�:���_���E��L��-�=���
`x�����d�QD�BU��NT������wY�G�Y�+BvTay�X�)��#/��bd������k���w��{z.B��K�8:��t�������xhmU�/'�#
��h��V@��|���zd0��^�����������-�g���Jd������?����������~�)FRX7T�����{���3��N��B��3z��e�/��Py�o�wO����ff�#�Q�TH���[���l���8��3L���s���~���x	
��NA�����m��y��i,��ikb�)�{�DY�a*B`�l>7��qW�m��Du�wK4��	��L����kH&�+�t���"�t����(#�\��_���h#R+�x�B����d�P��������@w�������9�m��lj��M9\��!?�f@�O�N��B�����KEV-D���i�������\I�����`�(���?�c�������8����Oo��2ynGzb��.�)L��<:��� �_��y�x�!c	�����:��]P���q<l�����xa>��de|�2Q$�T�0��AT�p�gt�����y����7�h���2�RW����������[�b"�I)��7���S�6���*�B,!�/�9�V�����(&,Q�$go�=��}!����yh�������)t0�a�Kx�8���Y�F�L�����NU��CMx��.�P
��w�s�Bf�_���8�[n[�GA�`���r�`o��9R��d����	=Oj���H&v�����1��u�(������D]=D���,?�N�!�����P�����8�c�����T_l��G�i4���h�s;��#,��c�	�z�0/�EZb��f��o?��$��t�P���16��iNL��m-�vmuP"��Z�Nb���X�9Js��
s
4�����y7,S�l�*v��N%������Z���bG�C�A-��1�H�eOt�|���d����Z�W���YAQ�1�+�.���@��|���dk�Y���M�}���|C:��_������"�Y�m���
I�1�^��m&��� Z�`�h}~�I���Tp������|��A?��j�T"�Q�S.��+�2>��6>�n�4=�
A�Y�W�a@W]�z^i%���;O_Mt��0_Os���P�J�-ev��W�p�j�xw4�m�M�������u�n�m�����\
�l���(AnzWc�~�^���T>=Tg��<e���y<lf5M�9r��Y����A|��o��g���w��g�G�w�8�A�)�("�V����3v�rw��BpKc�p��7A{v
���lk�g���k�+{��A���&H��1}$#(�������[�\~�u J<�\��o����7��#��c���9�_���]1����%�������l;�����-�'�3���N#W��H�r)�����8-�P�Y�p�
6�81(�AT�)�sss��X�!E_�F��&��1��X$7��`�����{#��|����7�(l����C3���W�;���8q�P���0�v�(�T�8'd|!�KJ�i��W�������SU~�x��$_9c�*�3�:;���]���3a����o=��h:����T����a.A!�����R�pm-��Z:�^�L|!�y�����E����Z.��� ;�� ?����j�U|��$���8;��#��v����zfk�t����W����\�s^���4����&���7|�����VbG��R�jeG~�����0�i�V������v�~.������NS$�eu��MFC��I#"���;�7J`���%L�l@<>E�3I��s6lR{D����B��-`U��a�n��B��,�$}o�^�	7DM:��h��n�X��.^�����VUX{���/��%!]Y�%�� �t8����W��N���:'`Q���.5��"�"�v�^����a�!pQ�Sn��>�/@���2�bdo9d�4R�
�J�L����?��5N���Cqxz�n�R���?��o���W�)�X��+<f���3!��
~�hg�������\T�.�T�.�������Z�Em��Z��9`Z0r?'O��`8������7�p|���;U���^�����J6��{X�cr�E8z�Yc�4�� ��R�����z���������L8
�3.�o/�$o+Q����u�����Hze<��>�����N{O�������v}������y1���f�#h������(92}c��,�����#� k�d@*x�S��!����\�6)�B�����
���h�i�w{h�s�M*g�\����a{�&{��%�wg?4>�hO���G���3�s��=���4o�
i)N��a{O�����Cf�3���L@�����#�
}kKY6�s\�k
Vg>Ee�*��NT��/�x	��4\�\�e�.q��g-��\X���4�D!���;�k���yK�bIceX��=�����oV��D�/Ap�<��s���_pg���0M�{��vN#u	�/���h,72��
�0�b������Em[-*p����`A��2�� ��
l|B�d�������[^E�$�b&�������@b�'����j)kk�A����
��H�����8/�d2�����b*78������XJ[�a)���
�0��|����P����7nU�(*8F�DF"|�l��T)�)�6��	�U�I
��}�s|&������a�*�Z#��=����G�2u���?d��A�r����W�;a]�����C�,DF.r43j)#�"���u��������j�<����B��+
�����Mo?(�_f�2pO[`��N���������@�����g���''*�����-�)��\[M�J�}�������t���N�_������K��[,�4�_����z������eI��V5N�ht�2��>-4V�/���^	B��T�����uB�7���A��^�����)A�&'#sjV"gjV"�`���gra���i�vJ������%�����T�{R����g;��'fX� ����%+���~��|�y	�?���d��rXu&��.��3�!��EU6{��RaG�I=���)��{&_}�A�B�e�!&���p�U{x���W��kW$w�l6�I��������J��Hz&{i�����[<Z�$>�GH_T�Q1�@�+�I����
-����t��`�}��C�+M��t�� 6���U����&n*�?/��N<6����{��U����;}����n#�T0	d>�����
�i�2�Q�)����}-_EY�6�/�>���\���	d��3��g+F��RLd���u��
�wbzc(^��'��w�ZeCK���8��HG�U'��e�!�����B�A����o��������M�\V
�����=0����n#B�
E���yJxZ�����O$EQM{%><�gf.����xV���5�he �N��d�r9��$qr��/�R7���m�>��H�gP�����1�N���C�QB9����P.��|�6�`�*���f��h��d
"���{�r�\����W	�U���Q��6;����8W��N�9�(�{�ms/�A�lO�\���{z�n���Dp��:����%%uw�6!W�a<�&����\ML�u��??*I�j���e�����Q5���^Rg��9�@�3�4		T�U���t�-C����S�V�p�KC��A����i�U$'����X����&���h�$�����d}�y�� �rJf�6�%��{���Z��������'A�����$�Bo�������2�Ve|�������
��@@g��;W��jP��E�*5�G	�Qb���	�d�g�
�V�v�o����1�$F�Xi��a=���c~y,�������G�J!,����W���1��r�X���l�R��`�%lQ���U��h��-VkA�X+�)[���&eK�JP)������w�G'OK�r!���O[�E�r�.�O��=����A�������"	�u����j��f�Gxy?�dc������H�:e�������r�T�pZ�����?�^�W�.�M���-�����z��3�K�����`M^�Jz'����d�K��g���7�����������o&d�_2�5L��A�3Tw�H�Q���+,3���4�==�|W-F�@~��|w����-a�� 
�+H���I�]J�H������?6�s��G��K�R5�Gu�\i5��;]���l�;q�F���B�3��/��|Q���p��n,��jE����O��a��a��)�0
���s@�U��i�e�8=k��_��/�U��p�N�p>7T���3ru���s
s]��(^+��:5�����h-�	qp�q� �[3�o-Ew	m�-'��T��F�����>d��tC����G�n.>���� �����@��R�x�'w5��^����@~������+a�6�B���	������U�Ib�Ks>��������N>���~}�{�_�K�_+���	�<�W�Gw�bI�$Zgaf���������J�!���z>CT�u@��<9V���@��Gj5H�Us���8^i�xT��������������b��;�����|6��*FV�)`\�����K�zU�����{��,q�a��Xys���?_L)H��EDr���_�J��^s����*<�>\���^��A�PL�/����19.���]�H��#������8lx|@W:sX�^��eI�������YMM���� �1Re:<z�^������*�;��L��z��a_7�~�H�f���P�e�� �#
]�p^�5�w��pxz�8z{B��:�?;[P0=����/�PE�
�~�B�u���*���R5���H���h��������I�.&����*bz]�y)V�E��c��1'{s�)��t�^*�I6U�O�];�	#�w��.�����q��D��F�M�u����R1��s��|�M��V���&'�"����_�;�Jt}@<�
z�9^�>��o���'j���w8���
��o��8�I������I��@B�����^�`�1/?��3���9������,���Q�G~=���`Un������q��[o�y��������������z��'mQ$�a&��R�t�thv?�)�0tZ'�����?4c�7�I�:��w�������jU2i��m���H[i��4zy�V��Z)z�D�5�M�p����b�����fv|��sj%�Z����HE�
�J�����s�u��L���D�'��
r��s���"��o��!q��D:(�b�$�RI�����<=��'N/.e�5���a�P���}.��������������:_Y�C$�%Hh_(U>�8X�Q���6�,���t����E�����sF�F��2g<�/��5H[Wx�X�j`�|�8X�'VGFf8/�Y����z%�X3F�����g=� �#���=J!_JE�?)�_.s�p���������������A#�������+#]���RTx�ud����� �p��JUWD,%E�eVb�B�8����F��e~����"x���	�R�-���G�6�	�9,�V�3�_�T-=���/�wh��*#����Z��S]A�,mW��O�
�*	�����x~��-W-&��$��u���3!����,e��[��z?��5P����S���1�k��6��}s:���_.�@BW���Z�>��r?������^���6c�L	\����P8C��	l�UXZ��NX�	m^n���?)�m�d^�z1������%?�s�w3��n�r4��E����7�) �K���������a������?�mSY�� ��onm��p{4�}�����N/��������x��?��^�
b���3*K��UlB����d8�\Ab�����������;���������N�xg�s:�9�9�/v&;�;�w>������W��sJ��S�`A����f��zPh���r�G�L��j��]�@���A%�:KS\+a������_M��C�Tq������g�(Q
b��$YgGe$�N�����j����3�Ds2��� 1�w{�m��!0�Mrc���J�Ko|���l�p*K%�����)�j����4 �u2{d>�E�zU�C�;����r|�0����8A�7��(x������C�������;f_����X�~������dE�R��3�yc�K��QB:j�����x�F�.z�V���m���6���0��Q,T�b�Ji�������pxiL�����tr�.����i���;�*�O'���+����Aq������|�rk�vz�!���GswP���6��$�A=���9���"�6oG�I�c�p.�e]4�96UQ*����QQUK�
F|�q\��
��R��V�N�n�Rl\Loo��{���2��"&��'il���\D���\G�T`��`�������@�+A��d)����rL���W�Bl�:��{'��B�(=�����|��������W��<�7�#����=(+����]���fA�
�����]��"���]t��[���v�Q����Qq��;y�N����mspok0�zL1Lq}������4�3��RA���"�H��O�G�^0���z#^H�SP��7�����N�xP��"
�G
#9Peter Eisentraut
peter_e@gmx.net
In reply to: Andrew Dunstan (#5)
Re: parallel restore

Andrew Dunstan wrote:

Still, that's not a 100% solution because of the cases where we use
reconnections to change user IDs --- the required password would
(usually) vary. It might be sufficient to forbid that case with
parallel restore, though; I think it's mostly a legacy thing anyway.

I didn't know such a thing even existed. What causes it to happen? I
agree it should be forbidden.

It was the only way to switch users before we had SET SESSION
AUTHORIZATION and SET ROLE and such. But the pg_restore man page says
that -R/--no-reconnect is obsolete, so I'm not sure what the current
behavior really is.

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#9)
Re: parallel restore

Peter Eisentraut <peter_e@gmx.net> writes:

Andrew Dunstan wrote:

I didn't know such a thing even existed. What causes it to happen? I
agree it should be forbidden.

It was the only way to switch users before we had SET SESSION
AUTHORIZATION and SET ROLE and such. But the pg_restore man page says
that -R/--no-reconnect is obsolete, so I'm not sure what the current
behavior really is.

Yeah, I think I was remembering ancient history. AFAICT we now never
do a reconnect with anything but the originally specified username.

I thought for a bit about stripping out the apparent flexibility to
use other names, and making these low-level functions just consult
ropt->username for themselves. But we might regret that someday.
What's probably better is to have them notice whether the argument
is ropt->username, and only attempt to cache the password if so.

I'm almost done reviewing the patch, and will send along an updated
version shortly.

regards, tom lane

#11Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#10)
Re: parallel restore

I wrote:

I'm almost done reviewing the patch, and will send along an updated
version shortly.

And here 'tis. I didn't commit because I have no way to test whether
I broke the Windows code path. Please test, and commit if OK.

There is an unfinished TODO item here: we really ought to make it work
for tar-format archives. That's probably not hugely difficult, but
I didn't look into it, and don't think we should hold up applying the
existing patch for it.

regards, tom lane

#12Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#11)
Re: parallel restore

Tom Lane wrote:

I wrote:

I'm almost done reviewing the patch, and will send along an updated
version shortly.

And here 'tis.

Many many thanks. Your edits look very sensible, as always.

I didn't commit because I have no way to test whether
I broke the Windows code path. Please test, and commit if OK.

Will do.

There is an unfinished TODO item here: we really ought to make it work
for tar-format archives. That's probably not hugely difficult, but
I didn't look into it, and don't think we should hold up applying the
existing patch for it.

Right. Were you thinking this should be done for 8.4?

cheers

andrew

#13Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#12)
Re: parallel restore

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

There is an unfinished TODO item here: we really ought to make it work
for tar-format archives. That's probably not hugely difficult, but
I didn't look into it, and don't think we should hold up applying the
existing patch for it.

Right. Were you thinking this should be done for 8.4?

If you have time to look into it, sure. Otherwise we should just put it
on the TODO list.

regards, tom lane

#14Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#11)
Re: parallel restore

Tom Lane wrote:

And here 'tis. I didn't commit because I have no way to test whether
I broke the Windows code path. Please test, and commit if OK.

Tested and committed.

Thanks to the people who reviewed and tested this - it was quite a
difficult piece of work, much more difficult than I originally expected.

cheers

andrew

#15Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#13)
Re: parallel restore

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

There is an unfinished TODO item here: we really ought to make it work
for tar-format archives. That's probably not hugely difficult, but
I didn't look into it, and don't think we should hold up applying the
existing patch for it.

Right. Were you thinking this should be done for 8.4?

If you have time to look into it, sure. Otherwise we should just put it
on the TODO list.

I've had a look at this. If our tar code supported out of order
restoration(using fseeko) I'd be done. But it doesn't, and I won't get
that done for 8.4, if at all. I'm not sure what would be involved in
making it work.

cheers

andrew

#16Andrew Dunstan
andrew@dunslane.net
In reply to: Andrew Dunstan (#15)
Re: parallel restore

I wrote:

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

There is an unfinished TODO item here: we really ought to make it work
for tar-format archives. That's probably not hugely difficult, but
I didn't look into it, and don't think we should hold up applying the
existing patch for it.

Right. Were you thinking this should be done for 8.4?

If you have time to look into it, sure. Otherwise we should just put it
on the TODO list.

I've had a look at this. If our tar code supported out of order
restoration(using fseeko) I'd be done. But it doesn't, and I won't get
that done for 8.4, if at all. I'm not sure what would be involved in
making it work.

OK, I've spent some more time on this. pg_dump when writing a custom
format file writes out the header and table of contents and then the
data members, keeping track of where each one starts. If the output is
seekable (as it usually is) it then rewrites the table of contents, this
time including the data member offsets. Parallel restore requires that
this offset info be available, and if the pg_dump output file was not
seekable by pg_dump (e.g. if it was a pipe) then it will be unsuitable
for use with parallel restore, which will fail.

In the case of tar output, pg_dump doesn't make any effort to keep the
offset info at all, so parallel restore is not currently suitable for
use with tar output, regardless of whether or not the pg_dump output was
seekable.

I think we could cure both of these cases by having pg_dump write out a
second copy of the table of contents, including data member offsets, at
the end of the archive. Or it might just be a table of <data-member-id,
offset> pairs if we're worried about space. In the latter case we'd need
to go back and fix up the TOC, but that would be fairly simple. Either
way I think we'd need to bump the archive version number so we'd know
when to expect this.

Once we have that the custom format code should fail on this no matter
how the dump was made, and parallel restore should work with tar format
once we add code to it to seek for data members.

I think all of this can wait to 8.5, except that we should possibly
document a bit more completely the current limitations on parallel restore.

(I was initially tempted to say we'd need compression of individual data
members in tar format to do this sanely, but since the
offsets-at-the-end suggestion should work even when pg_dump is
outputting to a pipe, we'd still be able to send the output through gzip
and so get a conventional .tgz file.)

cheers

andrew

#17Andrew Dunstan
andrew@dunslane.net
In reply to: Andrew Dunstan (#16)
Re: parallel restore

I wrote:

Once we have that the custom format code should fail on this no matter
how the dump was made, and parallel restore should work with tar
format once we add code to it to seek for data members.

s/should fail/should not fail/

:-)

cheers

andrew

#18Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#15)
Re: parallel restore

Andrew Dunstan wrote:

Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Tom Lane wrote:

There is an unfinished TODO item here: we really ought to make it work
for tar-format archives. That's probably not hugely difficult, but
I didn't look into it, and don't think we should hold up applying the
existing patch for it.

Right. Were you thinking this should be done for 8.4?

If you have time to look into it, sure. Otherwise we should just put it
on the TODO list.

I've had a look at this. If our tar code supported out of order
restoration(using fseeko) I'd be done. But it doesn't, and I won't get
that done for 8.4, if at all. I'm not sure what would be involved in
making it work.

Added to TODO:

Allow parallel restore of tar dumps

* http://archives.postgresql.org/pgsql-hackers/2009-02/msg01154.php

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +