• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

citusdata / pg_shard / 542
36%

Build:
DEFAULT BRANCH: develop
Ran 18 Sep 2015 05:24AM UTC
Jobs 5
Files 18
Run time 10s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
542

Pull #145

travis-ci

jasonmp85
Fix and improve hash token distribution algorithm

There are 2^32 distinct "hash tokens" in our hash space, but we were
using INT32_MAX (2^32 - 1) in the code instead. Because of this, shard
counts which one might expect to divide evenly into the space (such as
16, 32, or 256) had fewer tokens than they should have. The remainder
of the tokens were stuffed into the last shard, causing uneven load.

Though fixing the INT32_MAX bug solves the above case, it still doesn't
deal with the remainder, which can be as large as `shardCount - 1`. We
could continue stuffing it into the top shard, but I find it nicer to
have all shard sizes be within one token of one another.

We previously divided the shard count into the hash token count to get
a "hash token increment" and added that increment each iteration: this
gives something like shardIndex * (hashCount / shardCount). By changing
the grouping to (shardIndex * hashCount) / shardCount, the issue with
distributing the remainder goes away entirely and we get "nice" shards.
Pull Request #145: Fix and improve hash token distribution algorithm

5 of 5 new or added lines in 1 file covered. (100.0%)

2165 of 2268 relevant lines covered (95.46%)

1754.91 hits per line

Jobs
ID Job ID Ran Files Coverage
1 542.1 (PGVERSION=9.3) 18 Sep 2015 05:24AM UTC 0
95.15
Travis Job 542.1
2 542.2 (PGVERSION=9.4) 18 Sep 2015 05:24AM UTC 0
95.15
Travis Job 542.2
3 542.3 (PGVERSION=9.5) 18 Sep 2015 05:24AM UTC 0
95.15
Travis Job 542.3
4 542.4 (PGVERSION=40.0) 18 Sep 2015 05:24AM UTC 0
94.13
Travis Job 542.4
5 542.5 (PGVERSION=41.0) 18 Sep 2015 05:24AM UTC 0
94.13
Travis Job 542.5
Source Files on build 542
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #542
  • Pull Request #145
  • PR Base - develop (#532)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc