[elephant-devel] Re: Postmodern, Act II

Leslie P. Polzer leslie.polzer at gmx.net
Sat May 3 07:03:48 UTC 2008


>  LPP> With this enabled I sometimes get
>
>  LPP>   Database error 55000: currval of sequence "txn_id" is not yet LPP>   defined
in this session
>
> can you catch a backtrace? it seems to be quite relevant here

 6: (LAMBDA NIL)
    At
/home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern/pm-sql.lisp:157
 7: (LAMBDA NIL)
    At
/home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern/pm-btree.lisp:263
 8: (SB-PCL::FAST-METHOD ELEPHANT::EXECUTE-TRANSACTION
(DB-POSTMODERN::POSTMODERN-STORE-CONTROLLER
 T))
    At
/home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern/pm-transaction.lisp:
60
    Local variables:
      ARG-0 = 8
      ARG-3 = #<POSTMODERN-STORE-CONTROLLER (POSTGRESQL 127.0.0.1 mystic-world mystic
mystic PORT
5433)>
      ARG-4 = #<CLOSURE (LAMBDA NIL) {BA0738D}>
 9: (SB-PCL::FAST-METHOD (SETF DB-POSTMODERN::INTERNAL-GET-VALUE) (T T
DB-POSTMODERN::PM-BTREE))
    At
/home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern/pm-btree.lisp:263
    Local variables:
      ARG-2 = #<MYSTIC:PLAYER 10: (SB-PCL::FAST-METHOD ELEPHANT::PERSISTENT-SLOT-WRITER
(DB-POSTMODERN::POSTMODERN-STORE-CONTROLLER T T T))
    At
/home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern/pm-controller.lisp:266
    Local variables:
      ARG-2 = #<POSTMODERN-STORE-CONTROLLER (POSTGRESQL 127.0.0.1 mystic-world mystic
mystic PORT 5433)>
      ARG-3 = #<MYSTIC:PLAYER 11: (LAMBDA NIL)
    At
/home/sky/projects/mystic/hg.beta1/packages/elephant/src/elephant/classes.lisp:171 12:
DB-POSTMODERN::EXECUTE-TRANSACTION-ONE-TRY
    At
/home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern/pm-transaction.lisp:29
    Local variables:
      ARG-0 = #<POSTMODERN-STORE-CONTROLLER (POSTGRESQL 127.0.0.1 mystic-world mystic
mystic PORT 5433)>
      ARG-1 = #<CLOSURE (LAMBDA NIL) {BA066DD}>
      ARG-2 = NIL
13: (SB-PCL::FAST-METHOD ELEPHANT::EXECUTE-TRANSACTION
(DB-POSTMODERN::POSTMODERN-STORE-CONTROLLER T))
    At
/home/sky/projects/mystic/hg.beta1/packages/elephant/src/db-postmodern/pm-transaction.lisp:60
    Local variables:
      ARG-0 = 8
      ARG-3 = #<POSTMODERN-STORE-CONTROLLER (POSTGRESQL 127.0.0.1 mystic-world mystic
mystic PORT 5433)>
      ARG-4 = #<CLOSURE (LAMBDA NIL) {BA066DD}>


And here's the PostgreSQL point of view:

May  2 22:36:57 wintermute postgres[3702]: [16-1] ERROR:  currval of sequence "txn_id"
is not yet defined in this session
May  2 22:36:57 wintermute postgres[3702]: [16-2] CONTEXT:  SQL statement "INSERT INTO
update_log (txn_id, id, key) VALUES (currval('txn_id'),  $1 ,  $2 )" May  2 22:36:57
wintermute postgres[3702]: [16-3]       PL/pgSQL function "notify_btree_update" line 2
at SQL statement
May  2 22:36:57 wintermute postgres[3702]: [16-4]       SQL statement "SELECT 
notify_btree_update(2,  $1 )"
May  2 22:36:57 wintermute postgres[3702]: [16-5]       PL/pgSQL function
"ins_upd_slots" line 11 at perform
May  2 22:36:57 wintermute postgres[3702]: [16-6] STATEMENT:  select ins_upd_slots($1,$2)
May  2 22:36:57 wintermute postgres[3702]: [17-1] ERROR:  current transaction is
aborted, commands ignored until end of transaction block
May  2 22:36:57 wintermute postgres[3702]: [18-1] ERROR:  current transaction is
aborted, commands ignored until end of transaction block
May  2 22:36:57 wintermute postgres[3702]: [19-1] LOG:  execute <unnamed>: ABORT


> so this code path seems to be correct -- NEXTVAL is always called before CURRVAL.
>
> so only reason i can think of at moment (before looking into backtrace, at least) is
misconfiguration -- some processes/threads you launch have global sync cache enabled,
while others have not.

It might be that I forgot to enable the sync cache in those sessions;
I need to check this out. If this is the case we should detect it and
provide a meaningful error message.

  Leslie







More information about the elephant-devel mailing list