You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by ght230 <gh...@163.com> on 2015/06/19 11:43:18 UTC

A question about transactional spout for trident

Hello :

I have written a demo about trident. 
In the demo, I want to generate a series batches of data in a transaction spout and then do persistentAggregate operation for they.
The normal processing like this:
step1: txid=1, {"aaa 3", "bbb 2"}==>persist to DB(OK)
step2: txid=2, {"ccc 6", "ddd 7"}==>persist to DB(OK)

In the case that the operation of persist to DB is abnormal in step1, I suppose the process should be
step1: txid=1, {"aaa 3", "bbb 2"}==>persist to DB(NG)
step2: txid=1, {"aaa 3", "bbb 2"}==>persist to DB(OK)

But the test result is as following:
step1: txid=1, {"aaa 3", "bbb 2"}==>persist to DB(NG)
step3: txid=1, {"ccc 6", "ddd 7"}==>persist to DB(OK)

I think this process is not correct.But I do not know why it happen.
I have checked the zookeeper, in the path "meta/1, the value is null.
I wrote a transactional spout myself implement the interface ITridentSpout, I think it might be a problem with the spout I have written.
Anyone can give me some advice? Or give me a implemented transactional spout example for me to reference.

Thanks!




iceguo