-
Notifications
You must be signed in to change notification settings - Fork 23
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
SUBSCRIBE REQUEST ambiguity #204
Comments
Option 3 looks interesting. P1 can use a longer track namespace to steer the sub request from P2. Like a traffic engeering for content. |
I like option 2. I don't agree with treating track namespace as merely a string prefix. Even if you go with option 3, there's still a race condition where a late ANNOUNCE will cause a SUBSCRIBE to an unintended track. I want to give the track namespace more properties so it's treated more like a broadcast identifier. A few folks are headed down this path without realizing it, such as proposing that there's a single catalog per track namespace. I don't see how that would even work if ANNOUNCE is used purely for routing like a BGP announcement. |
@suhasHere : are you saying you believe that the relay resolves the described ambiguity by using 'longest prefix' matched (eg: option 3)?
Another option I hadn't considered based on this comment is that the relay would send OBJECTs from BOTH publishers since they both match the Full Track Name. This will break in the current design, since each publisher has their own Object Sequence and Group Sequence and when merged the consumer will be left with garbage. It also violates the logic described that says a Full Track Name can be used as a cache key. |
Yeah that seems quite problematic @afrind. Let's say a relay have two connected publishers who send IN ORDER:
A subscriber connects and issues:
What happens next?
These are in the order of Alan's options. I added option 4 based on Suhas' comment.
And to throw a wrench in things, a third publisher joins.
|
There's also the case where the relay replies to the subscribe requests on behalf of the publisher(s), so it doesn't have to make the routing decision at subscription time. But it does need to decide where to forward OBJECTs when they arrive. |
Implementing this now so I have some more thoughts. We should explicitly support UNANNOUNCE and UNSUBSCRIBE, which implicitly occur when the connection is dropped. Option 1
A radix tree is used for both so the relay can iterate through any values that match the given prefix. This is a global radix tree, similar to how QUIC connections are identified when variable length connection IDs are supported. Option 2
This is a strictly better than option 1. It provides the same functionality but faster, and without the restriction on namespace prefixes. Option 3Runs into issues with ANNOUNCE. example:
A similar issue occurs when UNANNOUNCE is fired, when happens implicitly when the connection is dropped:
Each subscription needs to keep reference to the track when the SUBSCRIBE was received, instead of doing a lookup based on full track name when each OBJECT is received. This will cause havok when resubscriptions occur, for example with ABR, as switching away from and back to a track MAY result in different content. Option 4It's not viable. The subscription would intermingle objects from separate publishers that happen share a prefix, all while using the same This is also the slowest option, as there needs to be a global RadixTree that maps tracks to subscriptions on receipt of each object. All other options listed above would keep an array of subscribers per track, resolved using a (shardable) HashMap. |
I think this seems like the right approach. Having 2 producers with conflicting namespaces is a bad idea, unless the authz policy and application is somehow OK with the consequences. I have added #225 to clarify the thinking further |
I'm of the view of two things 1) apps should not do this if it is a problem for that app usage of relay 2) relay should use the latest "announce" to override any earlier announces that are more specific ( or the same ) |
Discussed at IETF 117: Support in the room for changing "Full Track Name" from a single string to a tuple of Namespace and Track Name, and matching on Namespace exactly. |
IIRC, my recollection was not the same, also I don't think we concluded that the namespace match exactly. The discussion went over what the authz model defines and how that impacts the flow. |
Uh, my understanding of what we talking about what not at all removing Full Track Name - it was about we did not need to define a separator for concatenating things in a tuple. I don't agree there was support for chaning Full Track Name to Namesapce and Track Name tuple and only doing full matches. That is not going to work for many of the use cases and not what we are discussing. |
I thought what came out of this discussion is
Perhaps I have this recollection wrong but if so point me at right place in recording for that. |
My motivation for ANNOUNCE was for the contribution case. A client like OBS will connect to the server, ANNOUNCE a new catalog track, and then the server will issue a corresponding SUBSCRIBE to get the data flowing.
This is modeled after the QUICR PUBLISH_INTENT message, except that data doesn't flow until the other side issues a SUBSCRIBE. However, announcing a namespace prefix subverts this behavior:
The relay doesn't know if an ANNOUNCE is a prefix for routing, or a single broadcast being published. The relay effectively needs a business agreement with each client to determine. I think we should split this ANNOUNCE functionality into separate messages if just for the sake of discussion:
|
In the case of In the case of |
I assumed that full track name was a tuple already, and "full track name as a concatenation" was a notational convenience. Now that I read the draft more carefully, it does send full track name in messages, rather than a tuple of track name and track NS. As far as I'm concerned, this is a mistake -- I don't think this actually works, and I have no idea how one is supposed to implement that.
I believe "error" is actually equivalent to "keep first" here. I think it's a safety vs practicality trade-off. On one hand, if two different programs announce the same track, it will not work, since they will publish conflicting objects under the same name; if we disallow re-announcing, we will prevent that. On the other hand, re-announcing makes reconnects more practical. |
@fluffy Sorry if I misread the room and/or the author's meeting. Let's continue discussing.
That is being discussed in #225 / #227, let's keep this issue focused on the SUBSCRIBE REQUEST ambiguity? |
Individual comment: Just to illustrate the problem further here, I wrote a short sketch of a generic relay (python syntax):
So the concrete proposal I have is to change Then the first bit would change to:
This is not to say the every relay has to do matches in this way. By squishing the namespace and name together it's not possible to implement a relay that does exact matching. If we put the tuple in @fluffy Can you say more about the use cases that would break with a change like this, or suggest an alternate way to implement an exact matching relay? |
In a recent editor's call there was some discussion, which split into three separate issues - capturing it here:
I'd like to keep this issue focused on 1. |
Fixes #204 by explicitly specifying the namespace.
Fixes #204 by explicitly specifying the namespace. Also consistently changes to the (b) notation to indicate a variable length sequence of bytes.
Assume a setup with two publishers, a single relay and one subscriber.
P1 ANNOUNCE's track namespace fooba
P2 ANNOUNCE's track namespace foo
S1 sends a SUBSCRIBE REQUEST for Full Track Name
foobar
How does the relay know whether
foobar
is Track Namespace:foo
and Track Name:bar
, or Track Namespace:fooba
and Track Namer
, and hence which publisher to route the subscribe to?I see a few possibilities:
The relay should not allow this scenario (via namespace construction and/or authorization). If so the draft should include text explaining that this is disallowed (normatively?) or "bad things(tm)" happen.
Change SUBSCRIBE REQUEST to be able to disambiguate the Track Namespace from the Track Name. This could be done by sending name and namespace in separate message fields, or having stricter rules for the structure of Full Track Name such that a relay can extract the constituent parts.
Explicitly state that Full Track Names are matched to namespaces via "longest prefix match".
The text was updated successfully, but these errors were encountered: