Skip to content

Commit

Permalink
Issue #32: Output replica count when plan is reducing to 0 (#34)
Browse files Browse the repository at this point in the history
Motivation
----------
When reducing the number of replicas to zero, the Update statement in
the plan doesn't make clear what the change will be.

Modifications
-------------
Include the replica count in the Update statement of plans if either the
existing or new replica count is non-zero.

Results
-------
Operators can more readily see what changes their plan is making.
  • Loading branch information
brantburnett authored Apr 19, 2018
1 parent 4dc2d61 commit f25407b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app/update-index-mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ export class UpdateIndexMutation extends IndexMutation {
` -> ${this.definition.condition || 'none'}`));
}

if (!this.definition.manual_replica &&
this.definition.num_replica > 0) {
let hasReplica = Math.max(this.definition.num_replica,
this.existingIndex.num_replica) > 0;
if (!this.definition.manual_replica && hasReplica) {
logger.info(
chalk.cyanBright(
` Repl: ${this.definition.num_replica}`));
Expand Down
3 changes: 0 additions & 3 deletions example/beer-sample/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ num_replica: 0
name: DocsByType
index_key:
- type
partition:
exprs:
- type
---
name: BreweriesByAddress
index_key:
Expand Down

0 comments on commit f25407b

Please sign in to comment.