Browse Source

Expand volume fix

This patch allows new units with storage to be added into
an existing volume.

Change-Id: I6e0a0295a73b06c4cc59e20545d55c981ac1e5b4
Depends-On: I8b2ad6835f5c02852391858baa77c7fa38426da5
changes/51/482351/1
Chris Holcombe 2 years ago
parent
commit
aa9a6293b4
3 changed files with 3 additions and 6 deletions
  1. +1
    -2
      src/lib/charm/gluster/lib.py
  2. +1
    -1
      src/lib/charm/gluster/volume.py
  3. +1
    -3
      src/reactive/main.py

+ 1
- 2
src/lib/charm/gluster/lib.py View File

@@ -315,8 +315,7 @@ def get_brick_list(peers: Dict[str, Dict], volume: Optional[Volume]) -> Result:

else:
# Existing volume. Build a differential list.
log("Existing volume. Building differential brick list {} {}".format(
peers, volume))
log("Existing volume. Building differential brick list ")
new_peers = find_new_peers(peers, volume)

if len(new_peers) < replicas:


+ 1
- 1
src/lib/charm/gluster/volume.py View File

@@ -1260,7 +1260,7 @@ def volume_add_brick(volume: str, brick_list: List[Brick],
if not brick_list:
raise ValueError("The brick list is empty. Not expanding volume")
try:
bricks.add(volume, brick_list, force=force)
bricks.add(volume, [str(b) for b in brick_list], force=force)
except GlusterCmdException:
raise



+ 1
- 3
src/reactive/main.py View File

@@ -138,8 +138,6 @@ def initialize_volume(peer) -> None:
else:
log("Volume creation failed with error: {}".format(
create_result.value))
else:
set_state("volume.needs.expansion")
except GlusterCmdException as e:
log("Volume info command failed: {}".format(e))
return
@@ -300,7 +298,7 @@ def create_volume(peers: Dict[str, Dict],


@when('server.bricks.available')
@when('volume.needs.expansion')
@when('volume.created')
def check_for_expansion(peer) -> None:
"""
Possibly expand an existing volume


Loading…
Cancel
Save