Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACCUMULO-4331: first draft #111

Closed
wants to merge 10 commits into from
Closed

ACCUMULO-4331: first draft #111

wants to merge 10 commits into from

Conversation

dlmarion
Copy link
Contributor

@dlmarion dlmarion commented Jun 8, 2016

First draft. Did not implement the range syntax that was proposed in later comments, but would be easy to swap out. There are some ports where it seemed not to make sense to support a range, log4j monitor port being one as its also set as a system property.

PORT("port", Predicates.or(new Bounds(1024, 65535), in(true, "0")),
"An positive integer in the range 1024-65535, not already in use or specified elsewhere in the configuration"),
@SuppressWarnings("unchecked")
PORT("port", Predicates.or(new Bounds(1024, 65535), in(true, "0"), new Matches("\\d{1,5}-\\d{1,5}")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex could be a bit more restrictive, like \\d{4,5}-\\d{4,5}

Would there be a benefit for creating a Predicate to verify the port range, like maybe fail sooner (when setting a prop in shell). Instead of validating in getPorts().

@dlmarion
Copy link
Contributor Author

dlmarion commented Jun 9, 2016

There are no tests for TServerUtils.startServer. I think I can create some, the problem is that I don't know what ephemeral ports are open on any given test machine. Ideas?

@ShawnWalker
Copy link
Contributor

Maybe integrate the build-helper-maven-plugin to reserve ephemeral ports? http://www.mojohaus.org/build-helper-maven-plugin/reserve-network-port-mojo.html

@dlmarion
Copy link
Contributor Author

dlmarion commented Jun 9, 2016

I'll take a look, thanks @ShawnWalker

@dlmarion
Copy link
Contributor Author

dlmarion commented Jun 9, 2016

Added tests to TServerUtils. For some reason the MiniAccumuloCluster tests are failing for me now. Not sure how it is related yet.

@@ -168,8 +168,8 @@ public static void init(VolumeManager fs, ServerConfigurationFactory serverConfi
logConfigWatcher.start();

// Makes sure the log-forwarding to the monitor is configured
int logPort = conf.getPort(Property.MONITOR_LOG4J_PORT);
System.setProperty("org.apache.accumulo.core.host.log.port", Integer.toString(logPort));
int logPort[] = conf.getPort(Property.MONITOR_LOG4J_PORT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put brackets after the type instead of the variable? This is form is valid but discouraged. This occurs a couple different times in the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Good catch, didn't intend to do that

@dlmarion
Copy link
Contributor Author

dlmarion commented Jun 9, 2016

Tested locally with two tservers and port range appears to be working.

@dlmarion
Copy link
Contributor Author

FWIW, with this latest change I was able to start Accumulo to include two tablet servers with setting all of the *.port.client properties to the range of 11000-11006.

@dlmarion
Copy link
Contributor Author

Will apply manually.

@dlmarion dlmarion closed this Jun 14, 2016
client.shutdownTabletServer(Tracer.traceInfo(), context.rpcCreds(), finalServer, force);
}
});
for (int port : context.getConfiguration().getPort(Property.TSERV_CLIENTPORT)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realized that this logic is broken for a port of '0'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I wonder how long that has been around.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keith-turner
Copy link
Contributor

keith-turner commented Jun 14, 2016

Being lazy, I suspect the following is the behavior but not 100% sure. @dlmarion hoping you might know off the top of your head since you have been working this. If not I can research it more.

  • If I set a port to 100000 in the shell, it will fail and not change the port setting.
  • If I set a port to 5000-70000 in the shell, it will log an error in the shell and set the port to 5000-64K

If this is the behavior, then it seems inconsistent to me.

NOTE: I edited this comment and changed 7000 to 70,000, which was what I intended to type.

milleruntime added a commit to milleruntime/accumulo that referenced this pull request Sep 16, 2019
* Closes issue apache#111 in accumulo-testing
milleruntime added a commit to milleruntime/accumulo that referenced this pull request Sep 16, 2019
* Closes issue apache#111 in accumulo-testing
milleruntime added a commit that referenced this pull request Sep 16, 2019
* Closes issue #111 in accumulo-testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants