baking-bad / tzkt

😼 Awesome Tezos blockchain indexer and API
https://tzkt.io
MIT License
183 stars 35 forks source link

Tzkt 1.8.0, Tezos Mainnet: reached maximum value of sequence "BakingRights_Id_seq" #89

Closed amurde closed 2 years ago

amurde commented 2 years ago

Hello, i am running Tzkt for production. Mainnet, node version 12.2.

Tonight tzkt indexer hits the limits on sequence (as i understand it):

fail: Tzkt.Sync.Services.Observer[0] Failed to apply updates. 2200H: nextval: reached maximum value of sequence "BakingRights_Id_seq" (2147483647)

Please let me know if i can gather additional debug information. I am in situation when production service is down.

API and indexer is at version 1.8.0

Groxan commented 2 years ago

Hi! That's related to the issue, found yesterday. To solve it you need:

  1. Reset the sequence by executing the following SQL query in the DB:
    begin;
    lock table "BakingRights" in exclusive mode;
    select setval('"BakingRights_Id_seq"', (select max("Id") + 1 from "BakingRights"), false);
    commit;
  2. Update the indexer to the latest commit.

Also, please, stay tuned. The latest commit is just a hotfix. We are still investigating the issue and will prepare a release version within 2-3 days.

Groxan commented 2 years ago

And I'm really sorry about your production service. Just want to let you know that you can also reach us in Telegram, Discord, and Slack where we make live announcements in case of such issues, and generally answer faster.

amurde commented 2 years ago

Hello, yes, sequence resetting was working ok. Also applied latest hotfix.

Now it is ok with all my nodes.

Thank you!