update_sequence更改了cloudant db中的语义? [英] update_sequence changed semantics in cloudant db?

查看:66
本文介绍了update_sequence更改了cloudant db中的语义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了一个昏昏欲睡的ouchdb,并且我注意到数据库上的 _changes查询返回的不是数字的 update_sequence,例如

I use a cloudant couchdb and I've noticed see that the "_changes" query on the database returns an "update_sequence" that is not a number, e.g.

"437985-g1AAAADveJzLYWBgYM..........".

此外,响应不稳定:如果查询数据库3,我将获得3个不同的update_sequences

What is more, the response is not stable: I get 3 different update_sequences if a query the db 3 times.

update_sequence, since等的已知语义是否发生了变化?还是什么?

Is there any change in the known semantics of the "update_sequence", "since", etc. or what?

问候,
Vangelis

Regards, Vangelis

推荐答案

用罗伯特先前给出的答案概括一下:

Paraphrasing an answer that Robert has previously given:

更新序列值是不透明的。在CouchDB中,它们当前是整数,但在Cloudant中,该值是数据库中每个分片的序列值的编码。随着添加集群支持(通过BigCouch合并),CouchDB将来可能会采用此方法。

The update sequence values are opaque. In CouchDB, they are currently integers but, in Cloudant, the value is an encoding of the sequence value for each shard of the database. CouchDB will likely adopt this in future as clustering support is added (via the BigCouch merge).

在CouchDB和Cloudant中,_changes每次返回时都会返回一个 seq值如果您将其作为自回传,则可以保证返回较新的更新。 在故障转移的情况下,其中可能包括您已经看到的更改。

In both CouchDB and Cloudant, _changes will return a "seq" value with every row that is guaranteed to return newer updates if you pass it back as "since". In cases of failover, that might include changes you've already seen.

因此,从特定的更新序列开始,读取更改的正确方法是;

So, the correct way to read changes since a particular update sequence is this;


  1. 致电/ dbname / _changes吗?since =

  2. 阅读整个答复,申请进行更改

  3. 记录last_seq值作为新的检查点seq值。

不要解释这两个值,您不能比较它们是否相等。您可以根据需要在步骤2中记录任何 seq值作为当前检查点seq值。您无法做的关键是比较它们。

Do not interpret the two values, you can't compare them for equality. You can, if you need to, record any "seq" value as you go in step 2 as your current checkpoint seq value. The key thing you cannot do is compare them.

这篇关于update_sequence更改了cloudant db中的语义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆