SQLStreamStore
SQLStreamStore copied to clipboard
Should MsSqlStreamStoreV3.Migrate populate [MaxAge] and [MaxCount]?
I've cloned master branch today and trying to migrate to MsSqlStreamStoreV3. Schema has been updated to V3, but columns [MaxAge] and [MaxCount] have nulls. When debugging, I found that after the line
streamIds.IntersectWith(metadataStreamIds);
StreamIds becomes empty (it had 7671 entries).
Is it expected behaviour? Does new columns applicable only to MetadataSqlStreamIds and expected to be null for normal streams? Do you have any documentation explaining when metadata is created as separate row starting with "$$" ?
Also Schema version set to 3 at the beginning of Migrate method. This contradicts to
a data migration (copy any existing metadata into the columns). ... Migration is resumeable and idempotent. From https://github.com/SQLStreamStore/SQLStreamStore/pull/140
If the migration will fail later, user will not be able to re-run migration (unless manually reset extended property). It will be better to change version as the last step of migration, only if all steps are successful.
Yes it should and thanks for giving it a try. Will look into the migration test and strengthen the validation.
Agreed with rest of your statement regarding migration recoverability.
We started to use new version and it gave huge performance improvements: from 90% CPU on Azure Database Server to 1% CPU. I've also added to wiki https://github.com/SQLStreamStore/SQLStreamStore/wiki/Example-of-Migration-to-MsSqlStreamStoreV3