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

Database constraint preventing continued scanning of multichain #24

Open
TronBlack opened this issue Apr 25, 2017 · 4 comments
Open

Database constraint preventing continued scanning of multichain #24

TronBlack opened this issue Apr 25, 2017 · 4 comments

Comments

@TronBlack
Copy link

When scanning the multichain chain, a triplet of ids is added to a table triggering an database Integrity exception. ABE continues to retry getting the same exception.

Symptom: Data stops updating in the explorer. The multichain chain continues just fine.

@gidgreen
Copy link
Contributor

Thanks. Can you say anything about what happened in the transaction which triggered this? Or what sorts of things you were doing in general on the chain?

@TronBlack
Copy link
Author

TronBlack commented Apr 26, 2017

We were running load tests and adding 3000+ Assets. The problem is not with multichain, but with the explorer db construction.

We have a "fix" for it that allows it to continue. It is essentially just handling the Integrity exception so it doesn't get stuck.

I added two lines in Mce/SqlAbstraction.py.

@@ -405,6 +405,8 @@ class SqlAbstraction(object):
     def _execute(sql, stmt, params):
         try:
             sql.cursor().execute(stmt, params)
+        except (sql.module.IntegrityError) as e:
+            print "Found Integrity Error - continuing..."        
         except (sql.module.OperationalError, sql.module.InternalError, sql.module.ProgrammingError) as e:
             if sql.in_transaction or not sql.auto_reconnect:
                 raise

@gidgreen
Copy link
Contributor

Thanks. Do you have any more information about the integrity exception that was thrown? Foreign key? Unique key? And what SQL statement was executing at the time?

@bitcartel
Copy link
Contributor

@TronBlack Can you print the entire exception object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants