I have a very simple setup that I'm trying to get working where I am trying
to use Java to startup the necessary Sequoia components. Everything seems
to startup fine but as soon as I try to create a table I get an exception
like the following below, any and all help is welcome!
INFO 06/04/08 21:08:26 recoverylog - Creating recovery log table:
RECOVERY INFO 06/04/08 21:08:26 recoverylog - Creating checkpoint table:
CHECKPOINT INFO 06/04/08 21:08:26 recoverylog - Creating backend table:
BACKEND INFO 06/04/08 21:08:26 recoverylog - Creating dump table: DUMP
INFO 06/04/08 21:08:26 vdb - Request manager will parse requests
with the following granularity: COLUMN_UNIQUE
INFO 06/04/08 21:08:26 backend - Adding connection manager for
virtual user "dbuser"
INFO 06/04/08 21:08:27 vdb - Recovery log size: 0
INFO 06/04/08 21:08:27 vdb - Using Hedera properties
file: /hedera_jgroups.properties
INFO 06/04/08 21:08:27 UDP - sockets will use interface
fe80:0:0:0:213:ceff:fe85:832b%3
INFO 06/04/08 21:08:27 UDP - socket information:
local_addr=fe80:0:0:0:213:ceff:fe85:832b:33571, mcast_addr=228.8.8.9:45566,
bind_addr=/fe80:0:0:0:213:ceff:fe85:832b%3, ttl=2
sock: bound to fe80:0:0:0:213:ceff:fe85:832b:33571, receive buffer
size=131071, send buffer size=131071
mcast_recv_sock: bound to fe80:0:0:0:213:ceff:fe85:832b%3:45566, send
buffer size=131071, receive buffer size=131071
mcast_send_sock: bound to fe80:0:0:0:213:ceff:fe85:832b%3:33572, send
buffer size=131071, receive buffer size=131071
-------------------------------------------------------
GMS: address is fe80:0:0:0:213:ceff:fe85:832b:33571
-------------------------------------------------------
INFO 06/04/08 21:08:31 vdb - Group vdb connected to
Member(address=/fe80:0:0:0:213:ceff:fe85:832b:33571, uid=vdb)
INFO 06/04/08 21:08:31 vdb - First controller in group vdb
INFO 06/04/08 21:08:31 recoverylog - Checking recovery log consistency
INFO 06/04/08 21:08:32 backend - Detected backend as: Apache Derby
WARN 06/04/08 21:08:32 backend - Unable to test ResultSet.getObject
INFO 06/04/08 21:08:32 Controller - Adding VirtualDatabase vdb
INFO 06/04/08 21:08:32 enduser - The virtual database vdb has been
successfully added to the controller.
INFO 06/04/08 21:08:32 Controller - Waiting for connections on
192.168.1.100:33333
INFO 06/04/08 21:08:32 Controller - Controller started on 2008.04.06 15
at 09:08:32 PM PST
INFO 06/04/08 21:08:32 Controller - Controller 192.168.1.100:33333
ready, listening to requests ...
INFO 06/04/08 21:08:32 enduser - Controller 192.168.1.100:33333
ready, listening to requests ...
INFO 06/04/08 21:08:33 backend - Adding connection manager for
virtual user "user"
INFO 06/04/08 21:08:33 vdb - W 1 0 create table test(x int)
INFO 06/04/08 21:08:33 vdb - W 1 0 create table test(x int)
INFO 06/04/08 21:08:33 vdb - Notify failure of request: create
table test(x int)
WARN 06/04/08 21:08:33 vdb - Request 'create table test(x int)'
failed on all controllers
WARN 06/04/08 21:08:33 vdb - Request create table test(x int)
failed (Request 'create table test(x int)' failed on all controllers)
WARN 06/04/08 21:08:33 vdb - Request '1' failed (Request 'create
table test(x int)' failed on all controllers)
WARN 06/04/08 21:08:33 vdb - Error during command execution
(Request 'create table test(x int)' failed on all controllers)
ERROR06/04/08 21:08:33 StorageNode - Error accessing metadata server.
org.rlg.exceptions.ObjectServerException: Error starting up metadata
server. at
org.rlg.metadata.server.SequoiaMetadataServer.<init>(SequoiaMetadataServer.
java:294) at org.rlg.StorageNode.main(StorageNode.java:74)
Caused by:
org.continuent.sequoia.common.exceptions.driver.DriverSQLException: Message
of cause: Request 'create table test(x int)' failed on all controllers
at
org.continuent.sequoia.driver.Connection.statementExecute(Connection.java:3
004) at org.continuent.sequoia.driver.Statement.execute(Statement.java:478)
at org.continuent.sequoia.driver.Statement.execute(Statement.java:455) at
org.rlg.metadata.server.SequoiaMetadataServer.<init>(SequoiaMetadataServer.
java:257) ... 1 more
Caused by:
org.continuent.sequoia.common.exceptions.driver.protocol.BackendDriverExcep
tion: Request 'create table test(x int)' failed on all controllers
The example code is here:
_controller = new Controller(host,
_port,
10);
String vdbname = "vdb";
boolean usePool = true;
int sqlShortFormLength = 30;
boolean useStaticResultSetmetaData = true;
boolean enforceTableExistenceIntoSchema = true;
DistributedVirtualDatabase vdb =
new DistributedVirtualDatabase(_controller,
vdbname,
vdbname,
_maxConnections,
usePool,
_minThreads,
_maxThreads,
_maxThreadIdleTime,
sqlShortFormLength,
_clientFailoverTimeoutInMs, useStaticResultSetmetaData,
"/hedera_jgroups.properties",
enforceTableExistenceIntoSchema);
MessageTimeouts messageTimeouts = new MessageTimeouts(10000);
vdb.setMessageTimeouts(messageTimeouts);
NotificationBroadcasterSupport nbs = new
NotificationBroadcasterSupport();
vdb.setNotificationBroadcasterSupport(nbs);
_controller.setNotificationBroadcasterSupport(nbs);
ResultCacheColumnUnique rccu = new ResultCacheColumnUnique(0,
0); ResultCacheRule rcr = new ResultCacheRule("default",
false,
false,
36000);
rcr.setCacheBehavior(new EagerCaching(0));
rccu.setDefaultRule(rcr);
AbstractScheduler as = new
RAIDb1OptimisticQueryLevelScheduler(); boolean enforceTableLocking = true;
long deadlockTimeout = 1000;
String driverPath = null;
String driverClassname =
"org.apache.derby.jdbc.EmbeddedDriver"; String url = "jdbc:derby:" + db +
";create=true";
String connectionTestStatement = "values 1";
int nbOfWorkerThreads = 5;
WaitForCompletionPolicy policy =
new
WaitForCompletionPolicy(WaitForCompletionPolicy.FIRST,
enforceTableLocking,
deadlockTimeout);
int requestTimeout = 5000;
int recoveryBatchSize = 100;
String user = "dbuser";
String password = "dbpass";
deleteDir(new File("recoverylog"));
RecoveryLog rlog = new RecoveryLog(driverPath,
driverClassname,
"jdbc:derby:recoverylog;create=true", user,
password,
requestTimeout,
recoveryBatchSize);
rlog.setLogTableCreateStatement("CREATE TABLE",
"RECOVERY",
"BIGINT NOT NULL",
"VARCHAR(8192) NOT NULL",
"sqlStmt",
"VARCHAR(8192) NOT NULL",
"VARCHAR(8192)",
"CHAR(1) NOT NULL",
"BIGINT NOT NULL",
"BIGINT",
"BIGINT",
"INT",
",PRIMARY KEY (log_id)");
rlog.setCheckpointTableCreateStatement("CREATE TABLE",
"CHECKPOINT",
"VARCHAR(8192) NOT
NULL", "BIGINT",
",PRIMARY KEY (name)");
rlog.setBackendTableCreateStatement("CREATE TABLE",
"BACKEND",
"VARCHAR(8192) NOT NULL",
"VARCHAR(8192) NOT NULL",
"INTEGER",
"VARCHAR(8192) NOT NULL",
"");
rlog.setDumpTableCreateStatement("CREATE TABLE",
"DUMP",
"VARCHAR(8192) NOT NULL",
"TIMESTAMP",
"VARCHAR(8192) NOT NULL",
"VARCHAR(8192) NOT NULL",
"VARCHAR(8192) NOT NULL",
"VARCHAR(8192) NOT NULL",
"tables",
"VARCHAR(8192) NOT NULL",
"");
rlog.checkRecoveryLogTables();
RAIDb1_RR raidb1_rr = new RAIDb1_RR(vdb, policy);
RAIDb1DistributedRequestManager sddrm =
new RAIDb1DistributedRequestManager(vdb,
as,
rccu,
raidb1_rr,
rlog,
_beginTimeout, _commitTimeout,
_rollbackTimeout);
vdb.setRequestManager(sddrm);
deleteDir(db);
String backendname = "backend";
boolean writeCanBeEnabled = true;
DatabaseBackend backend =
new DatabaseBackend(backendname,
driverPath,
driverClassname,
url,
vdbname,
writeCanBeEnabled,
connectionTestStatement,
nbOfWorkerThreads);
VariablePoolConnectionManager vcpm =
new
VariablePoolConnectionManager(backend.getURL(), backendname, user,
password,
driverPath,
driverClassname,
20,
120,
1500,
4500);
AuthenticationManager auth = new AuthenticationManager();
vdb.setAuthenticationManager(auth);
backend.addConnectionManager("dbuser", vcpm);
backend.setDefaultConnectionManager(vcpm);
vdb.joinGroup(true);
vdb.addBackend(backend, true);
_controller.addVirtualDatabase(vdb,1,null);
_controller.launch();
Class.forName("org.continuent.sequoia.driver.Driver");
Connection conn =
DriverManager.getConnection("jdbc:sequoia://" + host + ":"
+ _controller.getPortNumber() + "/" + vdb.getDatabaseName(), "user",
"");
Statement stmt = conn.createStatement();
stmt.execute("create table test(x int)");
Thank you for your time,
Rodney.