question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Container migration from non-partitioned to partitioned does not work as in demo

See original GitHub issue

Describe the bug According to this migration demo reading the non-partitioned container (e.g. created in SDK v2) with SDK v3 should return the container with the PartitionKeyPath populated with default value (_partitionKey, I suppose). Instead, its value is null and the demo throws an exception.

To Reproduce Run the NonPartitionContainerMigration demo.

Expected behavior Container is read with default value of PartitionKeyPath other than null.

Actual behavior Exception is being thrown as the read container does not have PartitionKeyPath set (property’s value is null).

Environment summary SDK Version: 3.0.0, 3.1.1, 3.2.0-preview2 OS Version: Windows

Additional context I haven’t found any working solution to migrate the container from non-partitioned to partitioned. This prevents us from migrating to the newer version of SDK and utilizing additional features, including partitioning. Official docs aren’t really helpful and point to this not working demo.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bartsokolcommented, Sep 11, 2019

Seems like the issue is related with the Cosmos emulator version; I had 2.2.x version installed, after updating to 2.5.6 demo started working, so did the reading and writing items using the new SDK with PK set to PartitionKey.None. Maybe some update of the docs indicating the minimal emulator version would be useful?

0reactions
bartsokolcommented, Sep 12, 2019

One thing that needs an update in the docs is removal of reference to CosmosContainerSettings.NonePartitionKeyValue (likely to be replaced with PartitionKey.None?) from there, which I also reported to the azure-docs team.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to migrate an existing Postgres Table to partitioned ...
The table will grow indefinitely, so I have no sane "stop value" for how many tables to generate; The result should be as...
Read more >
Converting Nonpartitioned Classes to Partitioned Classes
Converting from a nonpartitioned storable class to a partitioned storable class should take about 30 minutes. The size of your tables does not...
Read more >
4.6 Changing a Nonpartitioned Table into a Partitioned Table
This mechanism is called online table redefinition. You can use online redefinition to copy nonpartitioned Collection Tables to partitioned Collection Tables ...
Read more >
Errors when migrating non-partitioned tables to ...
Errors can occur when migrating your non-partitioned tables to partitioned tables. Error messages are displayed in the trace file if any configuration ...
Read more >
Improve performance and manageability of large ...
Conclusion. Migrating from a monolithic table structure to a partitioned structure has clear performance, management, and lifecycle benefits.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found