Skip to content

Commit a16f129

Browse files
committed
v2.20.1: Exclude island with isolated shard 0 from rebalancing; write comprehensive log on every move action to a file
1 parent cbf4376 commit a16f129

40 files changed

+669
-454
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ At any moment, you can abort the move with ^C. It is safe: half-moved data will
178178
179179
<figure><img src="https://raw.githubusercontent.com/dimikot/ent-framework/refs/heads/main/gitbook/.gitbook/assets/pg-microsharding-move.png" alt=""><figcaption></figcaption></figure>
180180
181+
In addition to printing to console, `move` action also writes the same output to a log file in `/tmp/pg-microsharding.$uid` directory. Each individual move creates its own file prefixed with a timestamp and including the microshard number moved.
182+
181183
### Clean Old Moved Copies: pg-microsharding cleanup
182184
183185
```bash

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ At any moment, you can abort the move with ^C. It is safe: half-moved data will
182182
183183
<figure><img src="https://raw.githubusercontent.com/dimikot/ent-framework/refs/heads/main/gitbook/.gitbook/assets/pg-microsharding-move.png" alt=""><figcaption></figcaption></figure>
184184
185+
In addition to printing to console, `move` action also writes the same output to a log file in `/tmp/pg-microsharding.$uid` directory. Each individual move creates its own file prefixed with a timestamp and including the microshard number moved.
186+
185187
### Clean Old Moved Copies: pg-microsharding cleanup
186188
187189
```bash

docs/functions/actionList.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **actionList**(`args`): `Promise`\<`boolean`\>
1010
11-
Defined in: [src/actions/actionList.ts:28](https://github.com/clickup/pg-microsharding/blob/master/src/actions/actionList.ts#L28)
11+
Defined in: [src/actions/actionList.ts:29](https://github.com/clickup/pg-microsharding/blob/master/src/actions/actionList.ts#L29)
1212

1313
Shows the list of microshards and their weights.
1414

docs/functions/actionMove.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **actionMove**(`args`): `Promise`\<`boolean`\>
1010
11-
Defined in: [src/actions/actionMove.ts:19](https://github.com/clickup/pg-microsharding/blob/master/src/actions/actionMove.ts#L19)
11+
Defined in: [src/actions/actionMove.ts:21](https://github.com/clickup/pg-microsharding/blob/master/src/actions/actionMove.ts#L21)
1212

1313
Moves a shard from one database to another with no downtime.
1414

docs/functions/actionRebalance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
> **actionRebalance**(`args`): `Promise`\<`boolean`\>
1010
11-
Defined in: [src/actions/actionRebalance.ts:22](https://github.com/clickup/pg-microsharding/blob/master/src/actions/actionRebalance.ts#L22)
11+
Defined in: [src/actions/actionRebalance.ts:23](https://github.com/clickup/pg-microsharding/blob/master/src/actions/actionRebalance.ts#L23)
1212

1313
Runs a series of shard modes, concurrently, using TMUX if available.
1414

docs/functions/calcIslandWeights.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ Defined in: [src/actions/actionList.ts:193](https://github.com/clickup/pg-micros
1414

1515
| Parameter | Type |
1616
| ------ | ------ |
17-
| `__namedParameters` | \{ `dsns`: `string`[]; `weightSql`: `undefined` \| `string`; `verbose`: `boolean`; `includeIsolatedShard0`: `boolean`; \} |
17+
| `__namedParameters` | \{ `dsns`: `string`[]; `weightSql`: `undefined` \| `string`; `verbose`: `boolean`; \} |
1818
| `__namedParameters.dsns` | `string`[] |
1919
| `__namedParameters.weightSql` | `undefined` \| `string` |
2020
| `__namedParameters.verbose`? | `boolean` |
21-
| `__namedParameters.includeIsolatedShard0` | `boolean` |
2221

2322
## Returns
2423

docs/functions/weights.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,22 @@
66

77
# Function: weights()
88

9-
> **weights**(`__namedParameters`): `Promise`\<`object`[] \| `null`\>
9+
> **weights**(`__namedParameters`): `Promise`\<`object`[]\>
1010
11-
Defined in: [src/api/weights.ts:16](https://github.com/clickup/pg-microsharding/blob/master/src/api/weights.ts#L16)
11+
Defined in: [src/api/weights.ts:12](https://github.com/clickup/pg-microsharding/blob/master/src/api/weights.ts#L12)
1212

1313
Similar to listActiveSchemas(), but also returns the weight of each
1414
microshard and its number.
1515

16-
Returns null in case this DSN needs to be excluded by the caller completely
17-
(e.g. when includeIsolatedShard0=false, and it's an isolated island with
18-
shard 0).
19-
2016
## Parameters
2117

2218
| Parameter | Type |
2319
| ------ | ------ |
24-
| `__namedParameters` | \{ `dsn`: `string`; `weightSql`: `undefined` \| `string`; `verbose`: `boolean`; `includeIsolatedShard0`: `boolean`; \} |
20+
| `__namedParameters` | \{ `dsn`: `string`; `weightSql`: `undefined` \| `string`; `verbose`: `boolean`; \} |
2521
| `__namedParameters.dsn` | `string` |
2622
| `__namedParameters.weightSql` | `undefined` \| `string` |
2723
| `__namedParameters.verbose`? | `boolean` |
28-
| `__namedParameters.includeIsolatedShard0` | `boolean` |
2924

3025
## Returns
3126

32-
`Promise`\<`object`[] \| `null`\>
27+
`Promise`\<`object`[]\>

package-lock.json

Lines changed: 72 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@clickup/pg-microsharding",
33
"description": "Microshards support for PostgreSQL",
4-
"version": "2.19.3",
4+
"version": "2.20.1",
55
"license": "MIT",
66
"keywords": [
77
"postgresql",

0 commit comments

Comments
 (0)