django-sharding icon indicating copy to clipboard operation
django-sharding copied to clipboard

Replica + PostgresShardGeneratedIDAutoField fails

Open M1ha-Shvn opened this issue 7 years ago • 4 comments

Hello. Here's a bug: image The problem occures, if I add replica to one of the shards, and use PostgresShardGeneratedIDAutoFieldat the same time. The reason is, that replicas have no SHARD_ID assigned, and iteration raises KeyError.

M1ha-Shvn avatar Dec 11 '17 06:12 M1ha-Shvn

I suppose, it should be db_settings.get('SHARD_ID') if replica is ignored, or something based on RountingStartegy, if replica is used.

M1ha-Shvn avatar Dec 11 '17 06:12 M1ha-Shvn

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.

JBKahn avatar Dec 11 '17 13:12 JBKahn

A year has passed. Any updates on this issue?

M1ha-Shvn avatar Dec 03 '18 12:12 M1ha-Shvn

Yeah, I'll get on this. Sorry I've been rather busy and when it wasn't the holiday season it slipped my mind.

JBKahn avatar Dec 03 '18 13:12 JBKahn