django-sharding
django-sharding copied to clipboard
Replica + PostgresShardGeneratedIDAutoField fails
Hello.
Here's a bug:
The problem occures, if I add replica to one of the shards, and use
PostgresShardGeneratedIDAutoField
at the same time. The reason is, that replicas have no SHARD_ID
assigned, and iteration raises KeyError
.
I suppose, it should be db_settings.get('SHARD_ID')
if replica is ignored, or something based on RountingStartegy, if replica is used.
Good catch, I'll update it in addition to the others. It's a busy few weeks for me right now but I'll slot in some time soon.
A year has passed. Any updates on this issue?
Yeah, I'll get on this. Sorry I've been rather busy and when it wasn't the holiday season it slipped my mind.