Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aeron archive - Extending recording #23

Closed
matteo-gsr opened this issue Jan 12, 2025 · 6 comments
Closed

Aeron archive - Extending recording #23

matteo-gsr opened this issue Jan 12, 2025 · 6 comments

Comments

@matteo-gsr
Copy link
Contributor

matteo-gsr commented Jan 12, 2025

When extending an existing recording for an exclusive publication, one needs to add to the exclusive pub channel the following parameters:

  • position
  • initial term id
  • term length

from the docs:

In order to extend the Recording without any gaps, when Aeron Archive creates a Subscription to the Publication to be recorded, the Subscription must have a [join position](https://theaeronfiles.com/aeron-transport/network-publications/receiving/#join-position) that matches the Recording stopPosition. In other words, the Subscription's start position should match the Recording's stopPosition. This can be achieved by setting the initial position on the Publication and starting the Recording before publishing any new messages on it. When the Recording starts, it will Subscribe to the Publication before any messages have been published on it, so the join position will be its initial position.

The initial position, initialTermId, termLength and mtuLength can be set on the new Publication by assigning values to its Channel, using values from the Recording:

final String publicationExtendChannel = new ChannelUriStringBuilder()
    .initialPosition(recording.stopPosition(), recording.initialTermId(), recording.termBufferLength())
    .mtu(recording.mtuLength())
    // other channel params...
    .build();

if you look at https://github.com/real-logic/aeron/blob/master/aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java#L1627, there's some specific logic on how to do it.

there's an equivalent impl in the C client, see aeron_uri_string_builder_set_initial_position. I think it's worth reusing the whole URI builder in the C client and expose that via an idiomatic rust builder?

@matteo-gsr matteo-gsr changed the title Extending existing recording Aeron archive - Extending existing recording Jan 12, 2025
@matteo-gsr matteo-gsr changed the title Aeron archive - Extending existing recording Aeron archive - Extending recording Jan 12, 2025
@mimran1980
Copy link
Owner

@matteo-gsr if you use version 0.1.60 it should now contain AeronUriStringBuilder, here is example usage

let builder = AeronUriStringBuilder::default();
builder.init_new()?;
builder
    .media(Media::Udp)? // very important to set media else set_initial_position will give an error of -1
    .mtu_length(1024 * 64)?
    .set_initial_position(127424949617280, 1182294755, 65536)?;
let uri = builder.build(1024)?;
assert_eq!("aeron:udp?term-id=-1168322114|term-length=65536|mtu=65536|init-term-id=1182294755|term-offset=33408", uri);

builder.init_new()?;
let uri = builder
    .media(Media::Udp)?
    .control_mode(ControlMode::Dynamic)?
    .reliable(false)?
    .ttl(2)?
    .endpoint("localhost:1235")?
    .control("localhost:1234")?
    .build(1024)?;
assert_eq!("aeron:udp?ttl=2|control-mode=dynamic|endpoint=localhost:1235|control=localhost:1234|reliable=false", uri);

@matteo-gsr
Copy link
Contributor Author

@mimran1980, any chance we can also have the parser?

https://github.com/real-logic/aeron/blob/master/aeron-client/src/main/c/uri/aeron_uri.c

I have already a channel &str, I just need to parse it, call set_initial_position and that should give me the updated uri. Else, I need to do the parsing myself.

@mimran1980
Copy link
Owner

mimran1980 commented Jan 15, 2025

There is a method called init_on_string which does this. However to make it more idiomatic, I also added FromStr to the builder so you can now do

let uri: String = AeronUriStringBuilder::from_str("aeron:udp?endpoint=localhost:8010")?
    .ttl(5)?
    .build(1024)?;

assert_eq!("aeron:udp?ttl=5|endpoint=localhost:8010", uri);

let uri = uri.parse::<AeronUriStringBuilder>()?
    .ttl(6)?
    .build(1024)?;

assert_eq!("aeron:udp?ttl=6|endpoint=localhost:8010", uri);

Note there is build_into if you want to reuse your string (remember to set max capacity on String first)

This change is in 0.1.63

@matteo-gsr
Copy link
Contributor Author

Thanks Mo - it looks like it's unable to extend an existing recording if one has multiple streams on the same channel?

[462454.655586750] log started 2025-01-15 18:06:48.482+0000
[462454.770873041] ARCHIVE: CMD_IN_AUTH_CONNECT [128/128]: correlationId=26 responseStreamId=20 version=68352 responseChannel=aeron:udp?endpoint=127.0.0.1:62352|term-length=65536|sparse=true|mtu=1408|session-id=-1615429856 encodedCredentialsLength=0
[462454.777440750] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [44/44]: controlSessionId=1434391453 INIT -> CONNECTING reason="connecting"
[462454.777476291] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [48/48]: controlSessionId=1434391453 CONNECTING -> CONNECTED reason="connected"
[462454.777632541] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=26 relevantId=1434391453 code=OK version=68352 errorMessage=
[462454.777638500] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [55/55]: controlSessionId=1434391453 CONNECTED -> AUTHENTICATED reason="authenticated"
[462454.777736208] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [45/45]: controlSessionId=1434391453 AUTHENTICATED -> ACTIVE reason="active"
[462454.777761166] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=29 relevantId=4 code=OK version=68352 errorMessage=
[462454.777862458] ARCHIVE: CMD_IN_LIST_RECORDINGS_FOR_URI [97/97]: controlSessionId=1434391453 correlationId=30 fromRecordingId=0 recordCount=2147483647 streamId=11002 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4001
[462454.778157041] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=30 relevantId=0 code=RECORDING_UNKNOWN version=68352 errorMessage=
[462454.778256750] ARCHIVE: CMD_IN_START_RECORDING2 [93/93]: controlSessionId=1434391453 correlationId=31 streamId=11002 sourceLocation=LOCAL autoStop=TRUE channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4001
[462454.779325333] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=31 relevantId=32 code=OK version=68352 errorMessage=
[462454.779398250] ARCHIVE: CMD_IN_LIST_RECORDINGS_FOR_URI [97/97]: controlSessionId=1434391453 correlationId=34 fromRecordingId=0 recordCount=2147483647 streamId=11004 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462454.779421041] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=34 relevantId=0 code=RECORDING_UNKNOWN version=68352 errorMessage=
[462454.779488250] ARCHIVE: CMD_IN_START_RECORDING2 [93/93]: controlSessionId=1434391453 correlationId=35 streamId=11004 sourceLocation=LOCAL autoStop=TRUE channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462454.841725791] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=35 relevantId=36 code=OK version=68352 errorMessage=
[462454.898231208] ARCHIVE: RECORDING_SIGNAL [52/52]: controlSessionId=1434391453 correlationId=31 recordingId=0 subscriptionId=32 position=0 signal=START
[462454.898436416] ARCHIVE: RECORDING_SIGNAL [52/52]: controlSessionId=1434391453 correlationId=35 recordingId=1 subscriptionId=36 position=0 signal=START
[462454.898468416] ARCHIVE: CMD_IN_LIST_RECORDINGS_FOR_URI [97/97]: controlSessionId=1434391453 correlationId=38 fromRecordingId=0 recordCount=2147483647 streamId=11005 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462454.898509333] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=38 relevantId=2 code=RECORDING_UNKNOWN version=68352 errorMessage=
[462454.898603875] ARCHIVE: CMD_IN_START_RECORDING2 [93/93]: controlSessionId=1434391453 correlationId=41 streamId=11005 sourceLocation=LOCAL autoStop=TRUE channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462454.898797416] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=41 relevantId=42 code=OK version=68352 errorMessage=
[462454.898857583] ARCHIVE: CMD_IN_LIST_RECORDINGS_FOR_URI [97/97]: controlSessionId=1434391453 correlationId=44 fromRecordingId=0 recordCount=2147483647 streamId=11001 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4000
[462454.898915875] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=44 relevantId=2 code=RECORDING_UNKNOWN version=68352 errorMessage=
[462454.898965916] ARCHIVE: CMD_IN_START_RECORDING2 [93/93]: controlSessionId=1434391453 correlationId=45 streamId=11001 sourceLocation=LOCAL autoStop=TRUE channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4000
[462454.900344291] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [41/41]: recordingId=1 position=0 INIT -> RECORDING reason=""
[462454.900566041] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [41/41]: recordingId=0 position=0 INIT -> RECORDING reason=""
[462454.962379625] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=45 relevantId=46 code=OK version=68352 errorMessage=
[462454.962450166] ARCHIVE: RECORDING_SIGNAL [52/52]: controlSessionId=1434391453 correlationId=35 recordingId=2 subscriptionId=36 position=0 signal=START
[462454.962496083] ARCHIVE: RECORDING_SIGNAL [52/52]: controlSessionId=1434391453 correlationId=41 recordingId=3 subscriptionId=42 position=0 signal=START
[462454.963673541] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [41/41]: recordingId=3 position=0 INIT -> RECORDING reason=""
[462454.963810208] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [41/41]: recordingId=2 position=0 INIT -> RECORDING reason=""
[462454.996101708] ARCHIVE: RECORDING_SIGNAL [52/52]: controlSessionId=1434391453 correlationId=45 recordingId=4 subscriptionId=46 position=0 signal=START
[462454.996799750] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [41/41]: recordingId=4 position=0 INIT -> RECORDING reason=""
[462455.770691000] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462456.771504791] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462457.773329541] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462458.774474833] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462459.775073750] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462460.776305291] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462461.776585750] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462462.777878208] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462463.778843541] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462464.780558166] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462465.781402500] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462466.782074125] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462467.784006208] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462468.784988791] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462469.786837083] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462470.788347416] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462471.788922875] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462472.789607666] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=1434391453 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462473.003758125] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [91/91]: recordingId=4 position=384256 RECORDING -> INACTIVE reason="image.isEndOfStream=false, image.isClosed=true"
[462473.003787458] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [43/43]: recordingId=4 position=384256 INACTIVE -> STOPPED reason=""
[462473.004215416] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [91/91]: recordingId=3 position=898944 RECORDING -> INACTIVE reason="image.isEndOfStream=false, image.isClosed=true"
[462473.004231416] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [43/43]: recordingId=3 position=898944 INACTIVE -> STOPPED reason=""
[462473.004399125] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [91/91]: recordingId=2 position=898944 RECORDING -> INACTIVE reason="image.isEndOfStream=false, image.isClosed=true"
[462473.004412458] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [43/43]: recordingId=2 position=898944 INACTIVE -> STOPPED reason=""
[462473.004506750] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [91/91]: recordingId=1 position=370157824 RECORDING -> INACTIVE reason="image.isEndOfStream=false, image.isClosed=true"
[462473.004516208] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [43/43]: recordingId=1 position=370157824 INACTIVE -> STOPPED reason=""
[462473.004588750] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [91/91]: recordingId=0 position=0 RECORDING -> INACTIVE reason="image.isEndOfStream=false, image.isClosed=true"
[462473.004604083] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [43/43]: recordingId=0 position=0 INACTIVE -> STOPPED reason=""
[462473.006628458] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [179/179]: controlSessionId=1434391453 ACTIVE -> DONE reason="request publication image unavailable: image.correlationId=25 sessionId=-1615429856 streamId=10 channel=aeron:udp?sparse=true|endpoint=127.0.0.1:7001"
Shutdown Archive...

-----

[462489.849448541] log started 2025-01-15 18:07:23.675+0000
WARNING: existing errors saved to: /data/aeron-archive/archive-2025-01-15-18-07-23-711+0000-error.log
[462490.025424500] ARCHIVE: CMD_IN_AUTH_CONNECT [127/127]: correlationId=26 responseStreamId=20 version=68352 responseChannel=aeron:udp?endpoint=127.0.0.1:50763|term-length=65536|sparse=true|mtu=1408|session-id=-647816514 encodedCredentialsLength=0
[462490.032050041] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [44/44]: controlSessionId=810985213 INIT -> CONNECTING reason="connecting"
[462490.032082458] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [48/48]: controlSessionId=810985213 CONNECTING -> CONNECTED reason="connected"
[462490.032249000] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=26 relevantId=810985213 code=OK version=68352 errorMessage=
[462490.032254916] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [55/55]: controlSessionId=810985213 CONNECTED -> AUTHENTICATED reason="authenticated"
[462490.032343833] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [45/45]: controlSessionId=810985213 AUTHENTICATED -> ACTIVE reason="active"
[462490.032367333] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=29 relevantId=4 code=OK version=68352 errorMessage=
[462490.032505500] ARCHIVE: CMD_IN_LIST_RECORDINGS_FOR_URI [97/97]: controlSessionId=810985213 correlationId=30 fromRecordingId=0 recordCount=2147483647 streamId=11004 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462490.032812708] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=30 relevantId=5 code=RECORDING_UNKNOWN version=68352 errorMessage=
[462490.032903250] ARCHIVE: CMD_IN_EXTEND_RECORDING2 [101/101]: controlSessionId=810985213 correlationId=31 recordingId=2 streamId=11004 sourceLocation=LOCAL autoStop=TRUE channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462490.033940958] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=31 relevantId=32 code=OK version=68352 errorMessage=
[462490.034054250] ARCHIVE: CMD_IN_LIST_RECORDINGS_FOR_URI [97/97]: controlSessionId=810985213 correlationId=34 fromRecordingId=0 recordCount=2147483647 streamId=11005 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462490.034106500] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=34 relevantId=5 code=RECORDING_UNKNOWN version=68352 errorMessage=
[462490.034159416] ARCHIVE: CMD_IN_EXTEND_RECORDING2 [101/101]: controlSessionId=810985213 correlationId=35 recordingId=3 streamId=11005 sourceLocation=LOCAL autoStop=TRUE channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462490.092711375] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=35 relevantId=36 code=OK version=68352 errorMessage=
[462490.158035166] ARCHIVE: RECORDING_SIGNAL [52/52]: controlSessionId=810985213 correlationId=31 recordingId=2 subscriptionId=32 position=898944 signal=EXTEND
[462490.159209625] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [41/41]: recordingId=2 position=898944 INIT -> RECORDING reason=""
[462490.159399416] ARCHIVE: CMD_OUT_RESPONSE [153/153]: controlSessionId=810985213 correlationId=31 relevantId=2 code=ERROR version=68352 errorMessage=cannot extend active recording 2 streamId=11004 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002
[462490.160054791] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [43/43]: recordingId=2 position=898944 INACTIVE -> STOPPED reason=""
[462490.160304958] ARCHIVE: RECORDING_SIGNAL [52/52]: controlSessionId=810985213 correlationId=35 recordingId=3 subscriptionId=36 position=898944 signal=EXTEND
[462490.160339000] ARCHIVE: RECORDING_SIGNAL [52/52]: controlSessionId=810985213 correlationId=31 recordingId=2 subscriptionId=32 position=898944 signal=STOP
[462490.160394875] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [41/41]: recordingId=3 position=898944 INIT -> RECORDING reason=""
[462490.160437541] ARCHIVE: CMD_IN_LIST_RECORDINGS_FOR_URI [97/97]: controlSessionId=810985213 correlationId=38 fromRecordingId=0 recordCount=2147483647 streamId=11001 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4000
[462490.160475083] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=38 relevantId=5 code=RECORDING_UNKNOWN version=68352 errorMessage=
[462491.024737250] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462492.026634541] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462493.027677833] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462494.028956666] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462495.030687083] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462496.032641125] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462497.034982333] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462498.035745208] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462499.036849625] ARCHIVE: CMD_OUT_RESPONSE [44/44]: controlSessionId=810985213 correlationId=-1 relevantId=-1 code=OK version=68352 errorMessage=
[462499.604487125] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [91/91]: recordingId=3 position=898944 RECORDING -> INACTIVE reason="image.isEndOfStream=false, image.isClosed=true"
[462499.604512125] ARCHIVE: RECORDING_SESSION_STATE_CHANGE [43/43]: recordingId=3 position=898944 INACTIVE -> STOPPED reason=""
[462499.604925625] ARCHIVE: CONTROL_SESSION_STATE_CHANGE [178/178]: controlSessionId=810985213 ACTIVE -> DONE reason="request publication image unavailable: image.correlationId=25 sessionId=-647816514 streamId=10 channel=aeron:udp?sparse=true|endpoint=127.0.0.1:7001"
Shutdown Archive...

In the second run, it's adjusting the URI based on the existing recording found:

Archive connected: archiveId=4    
Resume existing recording: recordingId=2, channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002, streamId=11004, initialTermId=-506230994, termBufferLength=16777216, stopPosition=898944, mtuLength=1408    
URI for extending recording: aeron:udp?term-id=-506230994|control-mode=dynamic|term-length=16777216|control=127.0.0.1:4002|init-term-id=-506230994|term-offset=898944    
Recording started: subscriptionId=32    
Resume existing recording: recordingId=3, channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002, streamId=11005, initialTermId=-506230994, termBufferLength=16777216, stopPosition=898944, mtuLength=1408    
URI for extending recording: aeron:udp?term-id=-506230994|control-mode=dynamic|term-length=16777216|control=127.0.0.1:4002|init-term-id=-506230994|term-offset=898944    
Recording started: subscriptionId=36    
Aeron archive error: (11): response for correlationId=38, errorCode=2, error: cannot extend active recording 2 streamId=11004 channel=aeron:udp?control-mode=dynamic|control=127.0.0.1:4002    

It doesn't happen if I only use one stream id per channel, it seems.

@matteo-gsr
Copy link
Contributor Author

Opened an issue @ aeron - real-logic/aeron#1719

@matteo-gsr
Copy link
Contributor Author

@mimran1980 - looks like it was fixed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants