Aeron Replaymerge永远不会合并

发布于 2025-02-09 21:23:14 字数 1973 浏览 1 评论 0原文

我的replaymerge被困在状态from_live_join中,然后由于没有进度而出现。它添加了无问题的实时目的地(我看到相应的订阅出现在Aeron-Stat中,onimageavailable调用回调)。 最终它完全赶上了,但没有过渡到下一个状态。

进行了调查后,我发现有问题的检查在功能应该stopandremovereplay其中> image.activetransportcount()> = 2是错误的,因为image.activetransportcount()停留在1。如果不是为此,请检查replaymerge将成功。

这是我的replaymerge参数:

replayChannel = "aeron:udp"
replayDestination = "aeron:udp?endpoint=localhost:0"
liveDestination = "aeron:udp?endpoint=localhost:0|control=localhost:12345"

我已经尝试了Java客户端和C ++客户端。我想念什么?

编辑: 客户端上的Aeron-stat给出了这样的外观:

 42:                    1 - rcv-local-sockaddr: 41 <some IP address>:54709
 43:          452,985,472 - sub-pos: 24 -106708072 3000 aeron:udp?control-mode=manual @0
 44:          452,985,472 - rcv-hwm: 28 -106708072 3000 aeron:udp?control-mode=manual
 45:          452,985,472 - rcv-pos: 28 -106708072 3000 aeron:udp?control-mode=manual
 46:                    1 - rcv-local-sockaddr: 41 0.0.0.0:39238
 47:          452,971,520 - sub-pos: 24 -106708098 3000 aeron:udp?control-mode=manual @452971520
 48:          452,985,472 - rcv-hwm: 89 -106708098 3000 aeron:udp?control-mode=manual
 49:          452,971,520 - rcv-pos: 89 -106708098 3000 aeron:udp?control-mode=manual

第一个驱动程序订阅来自replayDestination。所有的数字都会如您期望的那样上升,就像普通的重播一样。

第二个是来自添加的livedestination。一旦创建,它根本就不会赶上,这与我上面的初步评估相反。 sub-posrcv-pos被困在452971520的初始位置,但是rcv-hwm与该位置一起上升重播订阅。这不是表明正在收到数据,但未在实时目的地订阅中阅读?

我注意到replaymerge#image被简单地定义为,

image = subscription.imageBySessionId((int)replaySessionId);

因此我试图对sisscription我传递给replaymerge构造器,以便这两个图像都会在内部进行投票。那无济于事。

My ReplayMerge gets stuck in state ATTEMPT_LIVE_JOIN, then times out due to no progress. It adds the live destination with no issues (I see the corresponding subscription appear in aeron-stat and the onImageAvailable callback is invoked). Eventually it catches up fully but doesn't transition to the next state.

After an investigation, I found that the problematic check is in function shouldStopAndRemoveReplay where image.activeTransportCount() >= 2 is false because image.activeTransportCount() stays at 1. If it weren't for that check the ReplayMerge would succeed.

Here are my ReplayMerge parameters:

replayChannel = "aeron:udp"
replayDestination = "aeron:udp?endpoint=localhost:0"
liveDestination = "aeron:udp?endpoint=localhost:0|control=localhost:12345"

I've tried both the Java client and the C++ client. What am I missing?

EDIT: aeron-stat on the client side gives looks like this:

 42:                    1 - rcv-local-sockaddr: 41 <some IP address>:54709
 43:          452,985,472 - sub-pos: 24 -106708072 3000 aeron:udp?control-mode=manual @0
 44:          452,985,472 - rcv-hwm: 28 -106708072 3000 aeron:udp?control-mode=manual
 45:          452,985,472 - rcv-pos: 28 -106708072 3000 aeron:udp?control-mode=manual
 46:                    1 - rcv-local-sockaddr: 41 0.0.0.0:39238
 47:          452,971,520 - sub-pos: 24 -106708098 3000 aeron:udp?control-mode=manual @452971520
 48:          452,985,472 - rcv-hwm: 89 -106708098 3000 aeron:udp?control-mode=manual
 49:          452,971,520 - rcv-pos: 89 -106708098 3000 aeron:udp?control-mode=manual

The first driver subscription is from the replayDestination. All the numbers go up as you would expect, like a normal replay.

The second one is from the added liveDestination. Once created it doesn't catch up at all, contrary to my initial assessment above. sub-pos and rcv-pos are stuck at the initial position of 452971520, but the rcv-hwm goes up together with the position of the replay subscription. Doesn't this indicate that data is being received but not read on the live destination subscription?

I noticed that the ReplayMerge#image is simply defined as

image = subscription.imageBySessionId((int)replaySessionId);

So I tried to instead poll the Subscription I passed to the ReplayMerge constructor so that both images would get polled internally. That did not help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一口甜 2025-02-16 21:23:14

我解决了我的问题(在传递给replaymerge是特定于会话ID。

Aeron代码库中的文件replaymergetest.java可以使用它来

private final String publicationChannel = new ChannelUriStringBuilder()
    // ...
    .tags("1," + PUBLICATION_TAG)
    // ...
    ;

private final String replayChannel = new ChannelUriStringBuilder()
    .media(CommonContext.UDP_MEDIA)
    .isSessionIdTagged(true)
    .sessionId(PUBLICATION_TAG)
    .build();

,以便将重播频道的会话ID设置为publication与TAG publication_tag关联的publication。在出版媒体驱动程序和订阅媒体驱动程序的情况下,这也有效,但您仍然必须以某种方式将出版标签传达给订户,这可能会带来不便。

因此,我要寻求的解决方案是从录制的记录描述符中获取会话ID要重播,在较早的时候,我发现使用Aeronarchive#listrecordingsforuri(或类似)发现录音。

此gist 这是一个工作的显示了一个工作Replaymerge 跨媒体。

I fixed my issue (encountered with this code) by ensuring the replayChannel passed to the ReplayMerge is session ID-specific.

File ReplayMergeTest.java in the aeron codebase does it with

private final String publicationChannel = new ChannelUriStringBuilder()
    // ...
    .tags("1," + PUBLICATION_TAG)
    // ...
    ;

private final String replayChannel = new ChannelUriStringBuilder()
    .media(CommonContext.UDP_MEDIA)
    .isSessionIdTagged(true)
    .sessionId(PUBLICATION_TAG)
    .build();

so that the session ID of the replay channel is set to be that of the Publication associated to tag PUBLICATION_TAG. This works as well in the case where the publishing media driver and subscribing media driver are distinct but you still have to somehow communicate the Publication tag to the subscriber which might be inconvenient.

So the solution I'll be going for is to take the session ID from the recording descriptor of the recording to be replayed, at the earlier point where I discover recordings with AeronArchive#listRecordingsForUri (or similar).

This gist shows a working ReplayMerge across two media drivers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文