Hello,

I've been following mailing list advices in order avoid problems with
postgres/hibernate and select nextval issues (I use Hibernate and
Postgresql dialect). I decided to choose the solution with modifying
SELECT_FOR_UPDATE_PATTERN_STRING and recompiling controller jar
(2.10.10).

- At this moment I am experiencing the problem, and maybe you could
please push me into right direction with debugging it. What happens is
having hanging and not commited transactions. Controller logs say:

13:32:28,158 DEBUG controller.RequestManager.dating Begin transaction 24
13:32:28,158 DEBUG controller.RequestManager.dating Broadcasting
request select nextval ('blogs_id_seq')/... transaction 24 to all
controllers (Member(address=/10.1.32.89:32941,
uid=dating)->[Member(address=/10.1.32.89:32941, uid=dating)])
13:32:28,196 DEBUG controller.RequestManager.dating Logging transaction 24 begin
(I have two controllers but one is currently down- this shouldn't be a
problem I guess)
This transaction is never committed (there is no "Commit transaction
24 in log"). It is broadcasted, which I guess is good, but still not a
success.

- When executing "dump scheduler queues" in console, I can see
"pending read requests" and while debugging them I get what follows:
Request id: 367
   query: select nextval ('blogs_id_seq')
   parameters:
   login: dbuser
   autocommit: false
   transaction id: 24
   cacheable status: CACHEABLE
   isolation level: TRANSACTION_UNDEFINED
   start time: 1237210351194
   end time: 0
   timeout in seconds: 0
   persistent connection id: 0
   client ip address: /10.1.32.91
I have no idea why isn't this transaction committed and why "dump
scheduler queues" treats it as "read request" while it should be write
request since the modification I made.

- I use following  Load Balancing config:
      <LoadBalancer>
         <RAIDb-1>
            <WaitForCompletion policy="first"/>
            <RAIDb-1-LeastPendingRequestsFirst/>
         </RAIDb-1>
      </LoadBalancer>

- "show backend" displays "Active transactions: 48"

Do you have any clues how to proceed with this? For sure it is not an
application error - without sequoia it works fine.

Thanks in advance,
Leszek.


> Hi Jan-Hendrik,
>
> There has been a couple of posts on the list about PostgreSQL and sequences.
> The basic idea is that calls to setval/nextval must be broadcast. There
> are basically 2 options:
> - modify the Hibernate dialect as explained in
> http://sequoia.continuent.org/doc/latest/userGuide/ar01s06.html (see
> section 6.7)
> - update the Sequoia SQL parser  regular expression. You can find more
> details about this in this post:
> http://www.mail-archive.com/[email protected]/msg03691.html
>
> Thanks for your interest in Sequoia,
> Emmanuel
>
>> Currently I am really curious about Sequoia. The theory sounds fine and the
>> whole project seems very well documented.
>>
>> But there's one question that came up my mind concerning the primary keys
>> generated with SERIAL or BIGSERIAL data types.
>>
>> Generally, we're building a webapp based on
>> Java1.6/Spring/Hibernate/PostgreSQL.
>>
>> If we've got a RAIDb-1 config (multi-master-replication), how can I ensure,
>> that Hibernate will fetch the right serial number from the sequence of
>> postgres on the single database instances?
>>
>> Hibernate is configured to get the nextval() from the sequences, but is it
>> ensured that all othger instances return the same value from the instances?
>> The following case:
>>
>> DB1, table t1 has a sequence s1, currently at 350.
>> DB2, table t2 has a sequence s2, currently at 350 as well.
>>
>> Now, Sequoia asks DB1 to return the value of s1   which is now 351. In the
>> meantime, Another thread asks Sequoia again for a next value. As DB1
>> currently has more load Seq. Asks DB2 for a value. During the meantime, the
>> increase of s1 could not happen and DB2 returns 351 as well. So sooner or
>> later, both new datasets for table t1 will have a duplicate PK which is not
>> something I would like to see ;-)
>> So, is there any chance to walk-around this problem? Or is there a native
>> soluation by sequoia?
>>
>> What happens if we increment a sequence by 100 on one databse - is this
>> allowed? Will this crash the system? I am surely not the only person
>> encountering this problem :-)
>>
>> Any hint will be much appreciated.
>>
>> Kind regards from Germany!
>>
>>

_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to