citusdata / citusdata/citus

get_shard_id_for_distribution_column returns 0 when it can't find a shard

Open
#1,990 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

- `NULL` would be the better thing to return.
- `get_shard_id_for_distribution_column` isn't called called by anything other than our tests (it's not called by enterprise or shard_rebalancer)
- `get_shard_id_for_distribution_column` is [publicly documented](https://docs.citusdata.com/en/v7.2/reference/user_defined_functions.html#get-shard-id-for-distribution-column)
- This is an interface change so we shouldn't do it for 7.3 but probably should do it for 8.0

Contributor guide

Open the contributing guide

Research direction

Start with the tests that call get_shard_id_for_distribution_column and review the publicly documented user-defined function behavior. Check how the function handles a missing shard and confirm that enterprise and shard_rebalancer do not call it; done means the return behavior and corresponding tests and documentation reflect the agreed interface change.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.