can not rollback without "tm.rollback(t)"

74 views
Skip to first unread message

david.ch...@gmail.com

unread,
Dec 1, 2013, 11:05:53 AM12/1/13
to omid-p...@googlegroups.com
hi:

this is my test code , why it can't roalback , thanks


                Configuration hbaseConf = null;
TransactionManager tm = null;
Transaction t = null;

try {

hbaseConf = HBaseConfiguration.create();
hbaseConf.set("hbase.coprocessor.region.classes",
"com.yahoo.omid.regionserver.Compacter");
hbaseConf.set("tso.host", "localhost");
hbaseConf.setInt("tso.port", 1234);

tm = new TransactionManager(hbaseConf);
TTable table = new TTable(hbaseConf, "t1");

t = tm.begin();

Put p1 = new Put("1".getBytes());
p1.add("f1".getBytes(), "f1_1".getBytes(), "1".getBytes());
table.put(t, p1);

Integer.valueOf("a");

Put p2 = new Put("2".getBytes());
p2.add("f1".getBytes(), "f1_1".getBytes(), "2".getBytes());
table.put(t, p2);

tm.commit(t);
table.close();

} catch (Exception e) {
e.printStackTrace();
//tm.rollback(t);
}

Matthieu Morel

unread,
Dec 2, 2013, 8:38:15 AM12/2/13
to omid-p...@googlegroups.com
Hi,

Where exactly are you trying to roll back? in the catch of the exception?

Do you have an error message, a stacktrace, some logs?

Thanks,

Matthieu

Daniel Gómez Ferro

unread,
Dec 2, 2013, 9:36:55 AM12/2/13
to Matthieu Morel, omid-project
Hi,

If a commit fails the transaction is automatically aborted and rollbacked. I think a rollback on an already aborted transaction would fail, that might be what you are referring to (I can't check it right now). I agree it shouldn't be the case, a .rollback() of an aborted transaction should be a no-op.

Regards,
Daniel


--
You received this message because you are subscribed to the Google Groups "Omid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omid-project...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

david.ch...@gmail.com

unread,
Dec 2, 2013, 9:42:12 PM12/2/13
to omid-p...@googlegroups.com, Matthieu Morel
hi
     this is the omid log, i modified omid.sh   exec java -Xmx1024m -cp $CLASSPATH -Domid.maxItems=1000000 -Domid.maxCommits=1000000 -Dlog4j.configuration=log4j.properties com.yahoo.omid.tso.TSOServer -port 1234 -batch $BATCHSIZE -ha -zk localhost:2181 -ensemble 5 -quorum 3



root@localhost bin]# ./omid.sh tso
[04:01:44,356] WARN     1[Main Thread-SendThread(localhost.localdomain:2181)] - ZooKeeperSaslClient.<init>(ZooKeeperSaslClient.java:123) - SecurityException: java.lang.SecurityException: 无法定位登录配置 occurred when trying to find JAAS configuration.
[04:01:45,982] WARN  1627[Main Thread-EventThread] - ReadersAwareBuffer.<init>(ReadersAwareBuffer.java:38) - Allocated buffer
[04:01:46,310] WARN  1955[Main Thread-EventThread] - ReadersAwareBuffer.<init>(ReadersAwareBuffer.java:38) - Allocated buffer
[04:02:03,652]ERROR 19297[pool-7-thread-1] - PendingReadOp.logErrorAndReattemptRead(PendingReadOp.java:113) - Error: No such entry while reading entry: 1 ledgerId: 3 from bookie: /127.0.0.1:3181
[04:02:03,654]ERROR 19299[pool-7-thread-1] - PendingReadOp.logErrorAndReattemptRead(PendingReadOp.java:113) - Error: No such entry while reading entry: 1 ledgerId: 3 from bookie: /127.0.0.1:3184
[04:02:03,656]ERROR 19301[pool-7-thread-1] - PendingReadOp.logErrorAndReattemptRead(PendingReadOp.java:113) - Error: No such entry while reading entry: 1 ledgerId: 3 from bookie: /127.0.0.1:3185

david.ch...@gmail.com

unread,
Dec 3, 2013, 1:11:56 PM12/3/13
to omid-p...@googlegroups.com, Matthieu Morel, david.ch...@gmail.com
i change the bookkeeper's version to 4.1.0  , then it likes ok ,

[15:40:18,064] WARN     1[Main Thread-SendThread(localhost.localdomain:2181)] - ZooKeeperSaslClient.<init>(ZooKeeperSaslClient.java:123) - SecurityException: java.lang.SecurityException: 无法定位登录配置 occurred when trying to find JAAS configuration.
[15:40:18,532] WARN   469[Main Thread-EventThread] - ReadersAwareBuffer.<init>(ReadersAwareBuffer.java:38) - Allocated buffer
[15:40:18,555] WARN   492[Main Thread-EventThread] - ReadersAwareBuffer.<init>(ReadersAwareBuffer.java:38) - Allocated buffer
PARAM MAX_ITEMS: 1000000
PARAM BATCH_SIZE: 0
PARAM LOAD_FACTOR: 0.5
PARAM MAX_THREADS: 5
[15:40:30,077]TRACE 12014[Thread-2] - T





在 2013年12月3日星期二UTC+8上午10时42分12秒,david.ch...@gmail.com写道:

david.ch...@gmail.com

unread,
Dec 3, 2013, 1:18:35 PM12/3/13
to omid-p...@googlegroups.com, Matthieu Morel, david.ch...@gmail.com
this code  ,i hope it can't insert to table 't1', but now it also has one inserted, the old article said this,
Copy some files to HBase region servers

# cp target/omid-1.0-SNAPSHOT.jar /usr/lib/hbase/lib/
# cp src/main/native/libtso-commithashmap.so /usr/lib/hbase/lib/native/Linux-amd64-64/

i can't find /libtso-commithashmap.so file ,Is it because of that




在 2013年12月4日星期三UTC+8上午2时11分56秒,david.ch...@gmail.com写道:

david.ch...@gmail.com

unread,
Dec 3, 2013, 1:20:10 PM12/3/13
to omid-p...@googlegroups.com, Matthieu Morel, david.ch...@gmail.com
this code  ,i hope it can't insert to table 't1', but now it also has one inserted, the old article said this,
Copy some files to HBase region servers

# cp target/omid-1.0-SNAPSHOT.jar /usr/lib/hbase/lib/
# cp src/main/native/libtso-commithashmap.so /usr/lib/hbase/lib/native/Linux-amd64-64/

i can't find /libtso-commithashmap.so file ,Is it because of that




在 2013年12月4日星期三UTC+8上午2时11分56秒,david.ch...@gmail.com写道:
i change the bookkeeper's version to 4.1.0  , then it likes ok ,

david.ch...@gmail.com

unread,
Dec 3, 2013, 1:20:19 PM12/3/13
to omid-p...@googlegroups.com, Matthieu Morel, david.ch...@gmail.com
this code  ,i hope it can't insert to table 't1', but now it also has one inserted, the old article said this,
Copy some files to HBase region servers

# cp target/omid-1.0-SNAPSHOT.jar /usr/lib/hbase/lib/
# cp src/main/native/libtso-commithashmap.so /usr/lib/hbase/lib/native/Linux-amd64-64/

i can't find /libtso-commithashmap.so file ,Is it because of that




在 2013年12月4日星期三UTC+8上午2时11分56秒,david.ch...@gmail.com写道:
i change the bookkeeper's version to 4.1.0  , then it likes ok ,
Reply all
Reply to author
Forward
0 new messages