Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Egil.Orleans.Messaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1825,8 +1825,9 @@ this.RegisterStreamManager()
async (message, cursor) => await UpdateProjectionAsync(message));
```

The Event Hubs extensions support Orleans **10.3.1 and 10.4.0** with the same
package binary. On 10.4, enriched tokens share the built-in Event Hubs comparison
All OM packages require Orleans **10.4.0 or later**. Upgrade the Orleans packages
in your host together when upgrading OM. Enriched tokens share the built-in Event
Hubs comparison
domain: equal sequence numbers and event indexes compare equally regardless of
enrichment. Checkpoints still belong to their provider and complete `StreamId`;
this does not make positions from different streams interchangeable. The JSON
Expand Down
48 changes: 23 additions & 25 deletions Egil.Orleans.Messaging/docs/eventhubs-token-compatibility.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
# Event Hubs token compatibility
# Event Hubs token compatibility on Orleans 10.4

The stable core and Event Hubs extension retain their Orleans 10.3.1 minimum.
Only Event Hubs compilation uses the two 10.4 streaming/provider assemblies,
acquired through `PackageDownload`; restore, runtime and pack graphs retain 10.3.1.
All OM packages require Orleans 10.4.0 or later. The preview Journaling integration
uses Microsoft.Orleans.Journaling 10.4.0-alpha.1. Consumers must upgrade their Orleans
packages together; no mixed 10.3/10.4 runtime or compile-reference strategy is supported.
Shared dependency pins and coordinated package verification are owned by #285.

The enriched token overrides 10.4's protected compatibility-domain getter with
The enriched token overrides the protected compatibility-domain getter with
`typeof(EventHubSequenceToken)`, matching standard provider tokens in both comparison
directions. On 10.3.1, the CLR introduces an unused virtual slot because the base
getter does not exist. No explicit override mapping or missing base call is emitted.
This is established by actual packed-binary execution, not nuspec metadata alone.
Aliases and JSON discriminator values are unchanged. Provider plus full `StreamId`
remain the checkpoint identity. Generic-token public equality remains separate from
the provider's historical exact V1 checkpoint normalization at recovery boundaries.
directions. Aliases, field IDs and JSON discriminator values are unchanged. Provider
plus full `StreamId` remain the checkpoint identity. Generic-token public equality
remains separate from the provider's historical exact V1 checkpoint normalization at
recovery boundaries; upgrading the runtime does not discard existing checkpoint data.

Factory and cache recovery tests now run in the normal Event Hubs test project:

```powershell
pwsh -File Egil.Orleans.Messaging/scripts/test-eventhubs-compatibility.ps1
dotnet test Egil.Orleans.Messaging/Egil.Orleans.Messaging.slnx -c Release
```

The script packs once, checks the dependency minimum, uses a fresh package cache and
runs existing Event Hubs tests as external consumers on 10.3.1 and 10.4.0. Additional
10.4 cases cover the inherited per-event factory, real pooled provider cache recovery
for standard/enriched/historical exact V1 tokens, genuine eviction misses and generic
token rejection. Existing cases cover persisted JSON fixtures, Orleans serialization,
custom containers, null per-event tokens, metadata and outbox request context. SHA-256
verification checks both the unchanged package and each consumer's copied assembly against the packed DLL. Each run gets a unique feed and cache even when the output parent is reused.
Coverage includes symmetric equality/order/hash, sequence-before-index ordering,
persisted standard/enriched provider/full-stream checkpoint lookup, Orleans and JSON
serialization, default/custom/null-token containers, per-event metadata, inherited
factory cloning, historical exact V1 recovery through the real pooled provider cache,
and genuine eviction misses. The cache fixtures create separate broker events through
the enriched adapter.

Before the override, both symmetric equality cases failed on the packed 10.4
consumer; after the override, both version consumers passed. Broker connectivity and
a live pulling-agent subscription handshake remain coordinated validation work for
#285; this in-process suite does not claim either. No claim covers future versions or
NativeAOT.
Before the override, standard/enriched symmetric equality failed on Orleans 10.4;
the override restores both comparison directions. Actual StreamManager resume and
the live pulling-agent subscription handshake remain coordinated validation work for
#285. In-process cache tests do not claim broker connectivity or live handshake proof.

Issue: https://github.com/egil/framework/issues/282
Upstream: https://github.com/dotnet/orleans/pull/11155

65 changes: 0 additions & 65 deletions Egil.Orleans.Messaging/scripts/test-eventhubs-compatibility.ps1

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Egil.Orleans.Messaging.Tests.Streams.EventHubs;

public sealed class EventHubs104RecoveryTests
public sealed class EventHubsRecoveryTests
{
[Fact]
public void Inherited_event_factory_retains_enrichment()
Expand Down Expand Up @@ -78,9 +78,15 @@ public void Generic_tokens_remain_distinct_in_public_equality()
Assert.Throws<ArgumentOutOfRangeException>(() => token.CompareTo(genericV2));
}

public enum CheckpointKind { Standard, Enriched, HistoricalV1 }
public enum CheckpointKind
{
Standard,
Enriched,
HistoricalV1
}

private sealed class UnrelatedProviderToken(long sequenceNumber, int eventIndex) : EventSequenceToken(sequenceNumber, eventIndex);

private static (PooledQueueCache Cache, StreamId Stream) CreateCache()
{
var services = new ServiceCollection();
Expand Down
Loading