I noticed that if there is "assertion failed"-error, then restore the database from backup copy and current log (for example, using -a database option) incorrectly restores the currval/nextval of sequence. |
If your sequence definition is not declared with a NO CACHE clause there is a possibility this can happen. Fatal errors, assertions, power outages, unhandled systems exceptions could all cause the server to stop without a clean checkpoint. If your 'gap' is less than the default 100 values (or whatever you have your CACHE setting set to) then the above could be your issue. If your 'gap' is larger I would suspect an incomplete (-a) recovery. CACHE 100 sounds like a violation of The Watcom Rule, but what do I know? I use DEFAULT AUTOINCREMENT and... I also hate Java...
(09 Aug '16, 13:17)
Breck Carter
Replies hidden
Thanks Nick. Thanks Breck.
(10 Aug '16, 02:24)
Ilia63
Changing that to NO CACHE should prevent that entirely, but could have an affect upon performance. Going to the default cache of 100 would increase the pential for an even bigger gap than your current setting. In contrast assertion failures, fatal errors, unhandled expections, and system level shutdowns should be rare so the tradeoff is a function of rarity of the current risk verses the impact/consequences if/when it occurs.
(10 Aug '16, 09:03)
Nick Elson S...
|