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

Support 64bit Event Numbers #1213

Merged
merged 1 commit into from
Feb 20, 2017
Merged

Conversation

hayley-jean
Copy link
Member

Update Index to allow for long EventNumbers.
Add IndexEntryV3 to support long EventNumbers in the index.
Rename IndexEntry32Bit and IndexEntry64Bit to IndexEntryV1 and IndexEntryV2.

Update LogRecord to allow Commit- and PrepareLogRecord to write 64bit ExpectedVersions.
Add LogRecordVersions LogRecordV0 and LogRecordV1.
When reading out int.MaxValue ExpectedVersion on a V0 record, convert it to long.MaxValue.
When reading the metadata of a stream and the metadata record is V0 and the truncateBefore
has been set to int.MaxValue, set the truncateBefore to long.MaxValue.

Change EventNumber from int to long throughout the code base.
Change TruncateBefore and MaxCount from ints to longs.

Upgrade LogRecords from V0 to V1 during a scavenge.
Add LengthOffset to PosMap to store the difference in length that can come about during the upgrade.
Move the calculation of the NextLogPosition from the Readers into LogRecord itself so that
the LengthOffset can be taken into account when calculating the next position.
Add PosMapVersion to differentiate between deprecated, 12 byte and 16 byte PosMap versions.

Add 2 new flags to ChunkFooter - isMap16Bytes and IsUpgraded
IsMap16Bytes is set if the PosMap version is PosMapV3 and stores the length offset
IsUpgraded is set if the chunk has gone through an upgrade during a scavenge
which may have caused the records to increase in length.
If IsUpgraded is set on the chunk footer, the footer will not try to validate that
the logical data size is less than the physical data size.

Update ClientAPI to handle long ExpectedVersions.
Create a new set of client TcpCommands, and rename the old ones V1 for old clients
Add a new TcpClientDispatcher for handling V1 TcpCommands and converting long EventNumbers
to ints and back again when unwrapping or wrapping packages
Add a deprecatedDispatcher to TcpConnectionManager, which is set to the above dispatcher.
If a command can be parsed by the deprecatedDispatcher, use this for wrapping or unwrapping
all further packages being sent over this connection.

@hayley-jean hayley-jean force-pushed the stream-version-update branch 4 times, most recently from aaf5522 to 3c7f6ca Compare February 20, 2017 14:15
Update Index to allow for long EventNumbers.
Add IndexEntryV3 to support long EventNumbers in the index.
Rename IndexEntry32Bit and IndexEntry64Bit to IndexEntryV1 and IndexEntryV2.

Update LogRecord to allow Commit- and PrepareLogRecord to write 64bit ExpectedVersions.
Add LogRecordVersions LogRecordV0 and LogRecordV1.
When reading out int.MaxValue ExpectedVersion on a V0 record, convert it to long.MaxValue.
When reading the metadata of a stream and the metadata record is V0 and the truncateBefore
has been set to int.MaxValue, set the truncateBefore to long.MaxValue.

Change EventNumber from int to long throughout the code base.
Change TruncateBefore and MaxCount from ints to longs.

Upgrade LogRecords from V0 to V1 during a scavenge.
Add LengthOffset to PosMap to store the difference in length that can come about during the upgrade.
Move the calculation of the NextLogPosition from the Readers into LogRecord itself so that
the LengthOffset can be taken into account when calculating the next position.
Add PosMapVersion to differentiate between deprecated, 12 byte and 16 byte PosMap versions.

Add 2 new flags to ChunkFooter - isMap16Bytes and IsUpgraded
IsMap16Bytes is set if the PosMap version is PosMapV3 and stores the length offset
IsUpgraded is set if the chunk has gone through an upgrade during a scavenge
which may have caused the records to increase in length.
If IsUpgraded is set on the chunk footer, the footer will not try to validate that
the logical data size is less than the physical data size.

Update ClientAPI to handle long ExpectedVersions.
Create a new set of client TcpCommands, and rename the old ones V1 for old clients
Add a new TcpClientDispatcher for handling V1 TcpCommands and converting long EventNumbers
to ints and back again when unwrapping or wrapping packages
Add a deprecatedDispatcher to TcpConnectionManager, which is set to the above dispatcher.
If a command can be parsed by the deprecatedDispatcher, use this for wrapping or unwrapping
all further packages being sent over this connection.
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

Successfully merging this pull request may close these issues.

2 participants