ctubbsii commented on a change in pull request #2321:
URL: https://github.com/apache/accumulo/pull/2321#discussion_r738040293
##########
File path: server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
##########
@@ -1042,6 +1043,12 @@ public void run() {
throw new IllegalStateException("Exception getting manager lock", e);
}
+ // If UpgradeStatus is not at complete by this moment, then things are
currently
+ // upgrading.
+ if
(!upgradeCoordinator.getStatus().equals(UpgradeCoordinator.UpgradeStatus.COMPLETE))
{
Review comment:
Avoid `.equals` when comparing enums
```suggestion
if (upgradeCoordinator.getStatus() !=
UpgradeCoordinator.UpgradeStatus.COMPLETE) {
```
##########
File path:
server/base/src/main/java/org/apache/accumulo/server/rpc/HighlyAvailableServiceInvocationHandler.java
##########
@@ -47,10 +47,17 @@ public HighlyAvailableServiceInvocationHandler(I instance,
HighlyAvailableServic
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws
Throwable {
+
+ // If the service is upgrading, throw an exception
+ if (service.isUpgrading()) {
+ throw new ThriftNotActiveServiceException(service.toString(),
+ "Service can not be accessed while it is upgrading");
+ }
+
// If the service is not active, throw an exception
if (!service.isActiveService()) {
- LOG.trace("Denying access to RPC service as this instance is not the
active instance.");
- throw new ThriftNotActiveServiceException();
+ throw new ThriftNotActiveServiceException(service.toString(),
+ "Denying access to RPC service as this instance is not the active
instance");
}
Review comment:
Throwing the thrift exception back over the wire will make sure the
calling RPC client gets the message. However, it would still be useful to log
these messages at trace in this server's own log.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]