Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sui-indexer] Issue with starting sui-indexer #19542

Open
alexandrurosca opened this issue Sep 25, 2024 · 5 comments
Open

[sui-indexer] Issue with starting sui-indexer #19542

alexandrurosca opened this issue Sep 25, 2024 · 5 comments
Assignees
Labels

Comments

@alexandrurosca
Copy link

Hello,

I'm trying to start the sui-indexer but I got some issues, everything went well until checkpoint 6231247 but now is stuck with the following error:

ERROR commit_checkpoints{first=6231247 last=6231346}: sui_indexer::store: Error with persisting data into DB: PostgresError(DatabaseError(UnableToSendCommand, "error encoding message to server: value too large to transmit")), retrying...

Another option would be to get a snapshot for the indexer but I cannot find it anywhere:

sui-indexer --database-url <DATABASE_URL> restore ...

Does anyone one where can I get a snapshot for the indexer, because going from block 1 takes very long time.

Info:

start cmd:

sui-indexer --pool-size 50  --db-url <DATABASE_URL> indexer --rpc-client-url http://localhost:9000 --remote-store-url https://checkpoints.mainnet.sui.io --checkpoint-download-queue-size 500 --epochs-to-keep 10

sui-indexer binary was build on:

commit 4b0e0aceee7c3a8382b6798b8db084a3925aafbf (HEAD -> main, tag: sui_v1.35.0_1727196238_ci, tag: sui_v1.35.0_1727190285_rel_notes, origin/main, origin/HEAD)
@gegaowp
Copy link
Contributor

gegaowp commented Sep 25, 2024

Hi @alexandrurosca, thanks for the report!

get a snapshot for the indexer but I cannot find it anywhere:

this is still work in progress and has not been officially rolled out, stay tuned and it will be out in one of the coming several releases and yes that will significantly reduce the backfill time.

sui_indexer::store: Error with persisting data into DB

to unblock, can you try set env var PG_COMMIT_OBJECTS_PARALLEL_CHUNK_SIZE to 200? to narrow down the issue, can you share all error messages from pg_indexer_store file?

@gegaowp
Copy link
Contributor

gegaowp commented Oct 3, 2024

Did not hear back from the reporter since last week, assuming the issue is no longer relevant and closing it for now -- feel free to re-open if needed.

@gegaowp gegaowp closed this as completed Oct 3, 2024
@qkniep
Copy link
Contributor

qkniep commented Oct 8, 2024

I had the same issue, on a version of the main branch as of today. At some checkpoint around 6.23M, the indexer stopped making progress with the same error message as above. I tried changing the above environment variable and tuning some PostgreSQL parameters, both of which did not help. Finally, I found the environment variable CHECKPOINT_COMMIT_BATCH_SIZE in the code. Reducing that from 100 to 10 did unblock the indexer up to checkpoint 6379122, at which point it got stuck again. But when setting CHECKPOINT_COMMIT_BATCH_SIZE, PG_COMMIT_OBJECTS_PARALLEL_CHUNK_SIZE and PG_COMMIT_PARALLEL_CHUNK_SIZE all to 1, the indexer was able to progress past that point.

@gegaowp
Copy link
Contributor

gegaowp commented Oct 8, 2024

Hey @qkniep yes I was able to reproduce and the fix is wip.

@gegaowp gegaowp reopened this Oct 8, 2024
@gegaowp
Copy link
Contributor

gegaowp commented Oct 8, 2024

the fix pr #19754 is now merged to main

gegaowp added a commit that referenced this issue Oct 8, 2024
## Description 

- fixed a bug that caused mainnet indexer to stop, also got reported in
#19542, specifically here when
tx has many input objects / affected objects / recipients / affected
addresses etc. the expanded query will exceed the PG parameter limit of
65535
- also added ingestion tests for big tx indices & event indices and
better error tracing


## Test plan 

added ingestion tests for tx and event indices

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
gegaowp added a commit to gegaowp/sui that referenced this issue Oct 10, 2024
## Description 

- fixed a bug that caused mainnet indexer to stop, also got reported in
MystenLabs#19542, specifically here when
tx has many input objects / affected objects / recipients / affected
addresses etc. the expanded query will exceed the PG parameter limit of
65535
- also added ingestion tests for big tx indices & event indices and
better error tracing


## Test plan 

added ingestion tests for tx and event indices

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
gegaowp added a commit that referenced this issue Oct 10, 2024
- fixed a bug that caused mainnet indexer to stop, also got reported in
#19542, specifically here when
tx has many input objects / affected objects / recipients / affected
addresses etc. the expanded query will exceed the PG parameter limit of
65535
- also added ingestion tests for big tx indices & event indices and
better error tracing

added ingestion tests for tx and event indices

---

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] REST API:
gegaowp added a commit that referenced this issue Oct 11, 2024
## Description 

- fixed a bug that caused mainnet indexer to stop, also got reported in
#19542, specifically here when
tx has many input objects / affected objects / recipients / affected
addresses etc. the expanded query will exceed the PG parameter limit of
65535
- also added ingestion tests for big tx indices & event indices and
better error tracing


## Test plan 

added ingestion tests for tx and event indices

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:

## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants