Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For some time, there has been a demand for a feature to allow users to determine the redundancy status of partitioned regions and to restore any missing redundancy without having to trigger a full rebalance of the system.[1] [2] Currently, no simple internal API call or gfsh command exists that provides users with the redundancy status of all partitioned regions in a system and the only way to manually trigger redundancy recovery is to perform a rebalance operation, which is a resource-intensive operation that can potentially move a lot of data around and cause exceptions if transactions are running in the system.[3] In order to determine the redundancy status of all partitioned regions, a user has to use a workaround of repeatedly calling 

...

for every partitioned region in the system, the output of which contains a lot of information that is not relevant to redundancy status.[4]

Anti-Goals

These gfsh commands and internal API are not intended to facilitate moving buckets or data from one member to another. Nor are they intended to guarantee full redundancy after calling, as it is possible that there are not enough members in the cluster to allow regions to meet their configured redundancy. It is also not within the scope of this RFC to describe any REST API that may be created at a future point in time to make use of the proposed internal API.

...

Any proposed solution to the problem that did not use the existing rebalance logic would have to reimplement large and complicated areas of code in order to correctly create redundant copies on members. One possible other solution that would use the existing rebalance logic would be to provide additional arguments to the existing rebalance operation to prevent moving buckets and prevent moving primaries. Given that the rebalance operation is already complicated, and that it could be confusing from a user perspective to use the name “rebalance” for an operation that is not actually balancing any data load, this solution was rejected in favour of creating a new, specific operation to restore redundancy.

Errata

RestoreRedundancyBuilder should be renamed to RestoreRedundancyOperation throughout, and the interface should now be: 

public interface RestoreRedundancyOperation {
  RestoreRedundancyOperation includeRegions(Set<String> regions);

  RestoreRedundancyOperation excludeRegions(Set<String> regions);

  RestoreRedundancyOperation shouldReassignPrimaries(boolean shouldReassign);

  CompletableFuture<RestoreRedundancyResults> start();

  RestoreRedundancyResults redundancyStatus();
}

The class name change results in more consistent class names and the method name change results in more easily understandable and consistent code.

...

References to RestoreRedundancyDirector should be omitted.

This change reflects the fact that instead of introducing a new class, the existing CompositeDirector was modified slightly to allow it to be used when restoring redundancy.

...

The new methods added to the ResourceManager public interface should now be:

RestoreRedundancyOperation createRestoreRedundancyOperation()

Set<CompletableFuture<RestoreRedundancyResults>> getRestoreRedundancyFutures()

These changes reflect the new name of RestoreRedundancyOperation and better describe what is returned by the "get" method.

...

The section describing the Status enum should now read: 

...

This change raises the threshold for what is considered a successful operation from one that results in any level of redundancy for all regions to one that results in fully satisfied redundancy for all regions.

...

The following methods should be omitted from the description of the RestoreRedundancyResults interface:

void addRegionResults(RestoreRedundancyResults results);

void addPrimaryReassignmentDetails(PartitionRebalanceInfo details);

void addRegionResult(RestoreRedundancyRegionResult regionResult);

This change prevents leaking of internal classes through a public API and makes the RestoreRedundancyResults interface read-only.

...

The getTotalPrimaryTransferTime() method in the RestoreRedundancyResults interface should return a java.time.Duration object instead of a long.

This change is intended to help provide more reliable handling of time-based values, as without an explicitly provided time unit there exists a possibility of confusion over the meaning of a long time value.

...

RestoreRedundancyRegionResult should be renamed RegionRedundancyStatus throughout and the description of the class should now be:

Finally, the RegionRedundancyStatus object will be a data structure containing a snapshot of the name, configured redundancy, actual redundancy and a status representing the state of redundancy for a given region:

public interface RegionRedundancyStatus{
  enum RedundancyStatus {
    SATISFIED,
    NOT_SATISFIED,
    NO_REDUNDANT_COPIES
  }

 String getRegionName();

 int getConfiguredRedundancy();

 int getActualRedundancy();

 RedundancyStatus getStatus();
}

The name change prevents confusion between the RestoreRedundancyRegionResult and RestoreRedundancyResults classes and the extraction to an interface prevents leaking of internal classes through a public API. The method name change to getConfiguredRedundancy is intended to provide more clarity about what the method returns.

...

The section describing the success/error status of the restore redundancy gfsh command should now read:

...

This change brings the gfsh command output in line with the Status returned by the RestoreRedundancyResults.

The RestoreRedundancyBuilder interface should now be: 

...

This change allows for more easily understandable code.

The --dont-reassign-primaries argument should be renamed --reassign-primaries throughout. The default value of the argument will be true, so the behaviour described in the RFC will be unchanged.

This change brings the gfsh arguments in line with the RestoreRedundancyBuilderRestoreRedundancyOperation interface. 

...

The backwards compatibility and upgrade path section should now read:

Members running older versions of Geode will not be able to execute the restore redundancy command function, so if any such members are detected in the system, the gfsh commands will fail to start and return an error status.

This change takes into account the fact that it will be possible for individual members to successfully start a restore redundancy operation regardless of the other members in the system, but that attempting to send a function to an older member during executing of the gfsh command will result in an exception.

RestoreRedundancyRegionResult should be renamed RegionRedundancyStatus throughout.

This change prevents confusion between the RestoreRedundancyRegionResult and RestoreRedundancyResults classes.


References

Anchor
ref1
ref1
[1] https://issues.apache.org/jira/projects/GEODE/issues/GEODE-4250 

...