http://slony.info/documentation/2.1/advanced.html#AEN1425

4.1.2. Event Confirmations

When an event is processed by the slon process for a remote node, a CONFIRM message is generated by

inserting a tuple into the sl_confirm table.

This tuple indicates that a particular event has been confirmed by a particular receiver node.

Confirmation messages are then transferred back to all other nodes in the cluster.

http://slony.info/documentation/2.1/stmtwaitevent.html

http://slony.info/documentation/2.1/stmtsync.html

For instance, many people have run afoul of problems with SLONIK SUBSCRIBE SET, when subscribing a new
set. Be aware (and beware!) that a SLONIK SUBSCRIBE SET request will return the event confirmation almost immediately, even though there might be several hours of work to do before the subscription is ready. The trouble with SLONIK SUBSCRIBE SET is that it is processed as two events, one on the origin node, with a second event, to enable the subscription, on the subscriber. In order to more reliably monitor from within a slonik script that SLONIK SUBSCRIBE SET is complete, you may submit a SLONIK SYNC event after the subscription, and have the WAIT request wait on the SYNC event ... SYNC ... Generates a SYNC event on a specified node. ID = ival The node on which to generate the SYNC event. Example SYNC (ID = 1); WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = 2, WAIT ON=1); ... Slonik does not wait for event confirmations before performing this command.

根据以上的说明,

为了保证复数个Slonik命令的执行顺序关系,
通过SYNC和 WAIT FOR EVENT 命令来控制 
SUBSCRIBE SET 命令执行一直到完毕,才开始其它命令的执行。

我个人的理解是,SUBSCRIBE SET 命令实际执行完毕的时候,
无论Provider也好,还是Receiver也罢,其所拥有的sl_confirm表的内容,
都可以起到表示 SUBSCRIBE SET 命令实际执行完毕的作用。

所以只要 sync 与 wait for event 的 wait on 中的 id 相同,都是可以的。

SUBSCRIBE SET (ID = , PROVIDER = , RECEIVER = );
SYNC (ID = 1)
WAIT FOR EVENT (ORIGIN = , CONFIRMED = ALL, WAIT ON=);

SUBSCRIBE SET (ID = 999, PROVIDER = 1, RECEIVER = 2);
SYNC (ID = 2)
WAIT FOR EVENT (ORIGIN = 1, CONFIRMED = ALL, WAIT ON=2);

都是一样的效果

对Slony-I中wait on的理解的更多相关文章

  1. SQL SERVER 2005/2008 中关于架构的理解(二)

    本文上接SQL SERVER 2005/2008 中关于架构的理解(一)      架构的作用与示例 用户与架构(schema)分开,让数据库内各对象不再绑在某个用户账号上,可以解决SQL SERVE ...

  2. SQL SERVER 2005/2008 中关于架构的理解(一)

    SQL SERVER 2005/2008 中关于架构的理解(一) 在一次的实际工作中碰到以下情况,在 SQL SERVER 2008中,新建了一个新用户去访问几张由其他用户创建的表,但是无法进行查询, ...

  3. C++中 类的构造函数理解(一)

    C++中 类的构造函数理解(一) 写在前面 这段时间完成三个方面的事情: 1.继续巩固基础知识(主要是C++ 方面的知识) 2.尝试实现一个iOS的app,通过完成app,学习iOS开发中要用到的知识 ...

  4. ECshop中的session机制理解

    ECshop中的session机制理解     在网上找了发现都是来之一人之手,也没有用自己的话去解释,这里我就抛砖引玉,发表一下自己的意见,还希望能得到各界人士的指导批评! 此session机制不需 ...

  5. [开发技巧]·Numpy中对axis的理解与应用

    [开发技巧]·Numpy中对axis的理解与应用 1.问题描述 在使用Numpy时我们经常要对Array进行操作,如果需要针对Array的某一个纬度进行操作时,就会用到axis参数. 一般的教程都是针 ...

  6. 【C++】类中this指针的理解

    转自 苦涩的茶https://www.cnblogs.com/liushui-sky/p/5802981.html C++类中this指针的理解 先要理解class的意思.class应该理解为一种类型 ...

  7. Java中线程同步的理解 - 其实应该叫做Java线程排队

    Java中线程同步的理解 我们可以在计算机上运行各种计算机软件程序.每一个运行的程序可能包括多个独立运行的线程(Thread). 线程(Thread)是一份独立运行的程序,有自己专用的运行栈.线程有可 ...

  8. OpenGL中的像素包装理解

    OpenGL中的像素包装理解 像素包装 位图和像素图很少会被紧密包装到内存中.在许多硬件平台上,考虑到性能的原因位图和像素图的每一行的数据会从特殊的字节对齐地址开始.绝大多数编译 器会自动把变量和缓冲 ...

  9. tomcat的配置文件server.conf中的元素的理解

    tomcat的配置文件server.conf中的元素的理解 tomcat作为一个servlet服务器本身的配置文件是tomcat_home/conf/server.conf,这个配置文件中有很多元素, ...

  10. ubuntu下关于profile和bashrc中环境变量的理解

    (0) 写在前面 有些名词可能需要解释一下.(也可以先不看这一节,在后面看到有疑惑再上来看相关解释) $PS1和交互式运行(running interactively): 简单地来说,交互式运行就是在 ...

随机推荐

  1. Ubuntu跬步之图片管理digiKam

    Ubuntu下自带了Image Viewer,具备基本的图片浏览功能. 偶尔有些图片需要分组,添加标注,幻灯片浏览等,所以找了款图片管理软件digiKam. 安装 Ubuntu Software Ce ...

  2. AndroidManifest修改重打包全过程

    AndroidManifest修改重打包全过程: 作者: 蔡建良 2013-06-26 准备工具:apktool.jar和signapk.jar 下载: http://download.csdn.ne ...

  3. ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'

    use mysql mysql> select host, user from user; 将相应用户数据表中的host字段改成'%': update user set host='%' whe ...

  4. shell脚本中一些特殊符号

    在shell中常用的特殊符号罗列如下: # ;   ;; . , / \\ 'string'| !   $   ${}   $? $$   $* \"string\"* **   ...

  5. 嵌入式 详解udev

    如果你使用Linux比较长时间了,那你就知道,在对待设备文件这块,Linux改变了几次策略.在Linux早期,设备文件仅仅是是一些带有适当的属性集的普通文件,它由mknod命令创建,文件存放在/dev ...

  6. base64 encoding

    //https://en.wikipedia.org/wiki/Base64 std::string base64Encode(const std::vector<char>& b ...

  7. 8、NFC技术:让Android自动打开网页

    创建封装Uri的NdefRecord  public  NdefRecord  createUri(String  uriString);  public  NdefRecord  cre ...

  8. 解读Cardinality Estimation<基数估计>算法(第一部分:基本概念)

    基数计数(cardinality counting)是实际应用中一种常见的计算场景,在数据分析.网络监控及数据库优化等领域都有相关需求.精确的基数计数算法由于种种原因,在面对大数据场景时往往力不从心, ...

  9. httpd.conf 禁止运行PHP和html页面

    <VirtualHost *:80>    ServerName www.test.com    DocumentRoot /var/www/www.test.com    ErrorDo ...

  10. erlang 常用函数

    os:getpid() 获得erl.exe的进程表示符 application:start(appname,    Type), Type == permanent 表示一个应用死了,其它应用全部死掉 ...