Skip to content

Upgrading Indx version break tables #155

@mo-seph

Description

@mo-seph

After upgrading from a ~6mo old version of indx, existing boxes don't work. Deleting the box and recreating fixes. But some people might argue that that's not really data durability ;)

Trace attached for reference

oot DEBUG   2014-05-09 15:32:41,403 IndxUser, get_keys, connected_cb, check_cb
root    DEBUG   2014-05-09 15:32:41,405 indx_pg2 lookup_best_acct got_keys_cb
root    DEBUG   2014-05-09 15:32:41,444 indx_pg2: returning existing pool for db: indx, user: webbox
root    DEBUG   2014-05-09 15:32:41,444 Objectstore schema_upgrade, indx_conn_cb
root    DEBUG   2014-05-09 15:32:41,445 IndxConnectionPool runInteraction, args: (<function interaction_cb at 0x10c27bc08>,), kwargs: {}
root    DEBUG   2014-05-09 15:32:41,447 Objectstore schema_upgrade, interaction_cb, args: (), kwargs: {}
root    DEBUG   2014-05-09 15:32:41,447 Objectstore _curexec, args: ('LOCK TABLE tbl_acl, tbl_indx_core, tbl_keychain, tbl_tokens, tbl_users IN EXCLUSIVE MODE',), kwargs: {}
root    DEBUG   2014-05-09 15:32:41,448 indx_pg2: returning existing pool for db: ix_lifestream_a, user: ix_lifestream_a_rw
root    DEBUG   2014-05-09 15:32:41,449 Objectstore schema_upgrade, conn_cb
root    DEBUG   2014-05-09 15:32:41,449 Objectstore _curexec, args: ('SELECT value FROM tbl_indx_core WHERE key = %s AND boxid = %s', ['box_last_schema_version', 'lifestream_a']), kwargs: {}
CONN    DEBUG   2014-05-09 15:32:41,451 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  BoxHandler PUT request
CONN    DEBUG   2014-05-09 15:32:41,451 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore update, specified_prev_version: 105
root    DEBUG   2014-05-09 15:32:41,452 indx_pg2: returning existing pool for db: ix_lifestream_a, user: ix_lifestream_a_rw
root    DEBUG   2014-05-09 15:32:41,452 Objectstore update, iconn_cb
root    DEBUG   2014-05-09 15:32:41,452 IndxConnectionPool runInteraction, args: (<function interaction_cb at 0x10c609f50>,), kwargs: {}
CONN    DEBUG   2014-05-09 15:32:41,455 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore update, interaction_cb, cur: <txpostgres.txpostgres.Cursor object at 0x10c1d3c50>
CONN    DEBUG   2014-05-09 15:32:41,455 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore _curexec, args: ('LOCK TABLE wb_files, wb_versions, wb_latest_vers, wb_triples, wb_users, wb_vers_diffs, wb_latest_subjects IN EXCLUSIVE MODE',), kwargs: {}
CONN    DEBUG   2014-05-09 15:32:41,456 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore update, lock_cb, val: <txpostgres.txpostgres.Cursor object at 0x10c1d3c50>
CONN    DEBUG   2014-05-09 15:32:41,456 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore _curexec, args: ('SELECT latest_version FROM wb_v_latest_version',), kwargs: {}
CONN    DEBUG   2014-05-09 15:32:41,456 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore update, exec_cb, cur: <txpostgres.txpostgres.Cursor object at 0x10c1d3c50>
CONN    DEBUG   2014-05-09 15:32:41,456 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore update, ver_cb, latest_ver: [(105,)]
CONN    DEBUG   2014-05-09 15:32:41,457 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore do_check
CONN    DEBUG   2014-05-09 15:32:41,457 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  ObjectStoreASync - get_latest_objs, object_ids: [u'2014-05-09T15:32:36.686+01:00']
CONN    DEBUG   2014-05-09 15:32:41,457 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore _get_latest_ver, cur: <txpostgres.txpostgres.Cursor object at 0x10c1d3c50>
CONN    DEBUG   2014-05-09 15:32:41,457 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore _curexec, args: ('SELECT latest_version FROM wb_v_latest_version', []), kwargs: {}
CONN    DEBUG   2014-05-09 15:32:41,458 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore check_cb, value: None
CONN    DEBUG   2014-05-09 15:32:41,458 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore _get_latest_ver exec_cb, cur: <txpostgres.txpostgres.Cursor object at 0x10c1d3c50>
CONN    DEBUG   2014-05-09 15:32:41,458 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore _get_latest_ver ver_cb, row: [(105,)]
CONN    DEBUG   2014-05-09 15:32:41,459 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  get_latest_objs ver_cb: 105
CONN    DEBUG   2014-05-09 15:32:41,459 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore _curexec, args: ('SELECT id_results.triple_order as triple_order, j_subject.string as subject, j_predicate.string as predicate, j_object.string as obj_value, wb_objects.obj_type, wb_objects.obj_lang, wb_objects.obj_datatype, j_object.uuid, j_object.chunk FROM (WITH theid AS (SELECT unnest(wb_get_string_ids(%s)) AS someid) SELECT * FROM wb_latest_vers JOIN wb_triples ON wb_latest_vers.triple = wb_triples.id_triple WHERE subject_uuid IN (SELECT someid FROM theid)) AS id_results JOIN wb_strings j_subject ON j_subject.uuid = id_results.subject_uuid JOIN wb_strings j_predicate ON j_predicate.uuid = id_results.predicate_uuid JOIN wb_objects ON wb_objects.id_object = id_results.object JOIN wb_strings j_object ON j_object.uuid = wb_objects.obj_value_uuid ORDER BY triple_order, j_object.uuid, j_object.chunk', [[u'2014-05-09T15:32:36.686+01:00']]), kwargs: {}
CONN    DEBUG   2014-05-09 15:32:41,461 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore get_latest_objs exec_cb, cur: <txpostgres.txpostgres.Cursor object at 0x10c1d3c50>
root    DEBUG   2014-05-09 15:32:41,461 Objectstore combine_long_string_rows for len(rows) = 0, diff_row = False
root    DEBUG   2014-05-09 15:32:41,461 Objectstore combine_long_string_rows completed, len(new_rows) = 0
CONN    DEBUG   2014-05-09 15:32:41,461 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore get_latest_objs, rows_cb, rows: [], version: 105
root    DEBUG   2014-05-09 15:32:41,461 ObjectStore Types, Graph to_json, root_object_ids: []
CONN    DEBUG   2014-05-09 15:32:41,461 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore update, objs_cb, val: {'@version': 105}
root    DEBUG   2014-05-09 15:32:41,462 indx_pg2: returning existing pool for db: ix_lifestream_a, user: ix_lifestream_a_rw
root    DEBUG   2014-05-09 15:32:41,462 Objectstore update, conn_cb
root    DEBUG   2014-05-09 15:32:41,463 ObjectSetDiff conn: <indx.connectionpool.IndxConnectionPool instance at 0x10ce93200>, objs1: [], objs2: [{u'emotion': [{u'@value': u'depressed'}], u'@id': u'2014-05-09T15:32:36.686+01:00', u'location': [{u'@value': u'pub'}]}], version: 106
root    DEBUG   2014-05-09 15:32:41,463 ObjectSetDiff compare, objs1: [], objs2: [{u'emotion': [{u'@value': u'depressed'}], u'@id': u'2014-05-09T15:32:36.686+01:00', u'location': [{u'@value': u'pub'}]}]
root    DEBUG   2014-05-09 15:32:41,463 ObjectSetDiff: obj_to_obj, sub_obj: {u'@value': u'depressed'}
root    DEBUG   2014-05-09 15:32:41,463 ObjectSetDiff: obj_to_obj, sub_obj: {u'@value': u'pub'}
root    DEBUG   2014-05-09 15:32:41,464 ObjectSetDiff gen_queries, queries for diff, queries are: []
root    DEBUG   2014-05-09 15:32:41,464 ObjectSetDiff gen_queries, run_querylist running: query: INSERT INTO wb_vers_diffs (version, diff_type, subject_uuid, predicate_uuid, object, object_order) VALUES (%s, %s, wb_get_string_id(%s), wb_get_string_id(%s), NULL, NULL), (%s, %s, wb_get_string_id(%s), wb_get_string_id(%s), wb_get_object_id(%s, %s, %s, %s), %s), (%s, %s, wb_get_string_id(%s), wb_get_string_id(%s), wb_get_object_id(%s, %s, %s, %s), %s), params: [106, 'add_subject', u'2014-05-09T15:32:36.686+01:00', None, 106, 'add_triple', u'2014-05-09T15:32:36.686+01:00', u'emotion', 'literal', u'depressed', '', '', 1, 106, 'add_triple', u'2014-05-09T15:32:36.686+01:00', u'location', 'literal', u'pub', '', '', 1]
root    DEBUG   2014-05-09 15:32:41,466 ObjectSetDiff: obj_to_obj, sub_obj: {u'@value': u'depressed'}
root    DEBUG   2014-05-09 15:32:41,466 ObjectSetDiff: obj_to_obj, sub_obj: {u'@value': u'pub'}
root    DEBUG   2014-05-09 15:32:41,467 ObjectSetDiff gen_queries, queries for latest, queries are: []
root    DEBUG   2014-05-09 15:32:41,467 ObjectSetDiff gen_queries, run_querylist running: query: INSERT INTO wb_latest_vers (triple, triple_order) VALUES (wb_get_triple_id(%s, %s, %s, %s, %s, %s), %s), (wb_get_triple_id(%s, %s, %s, %s, %s, %s), %s), params: [u'2014-05-09T15:32:36.686+01:00', u'emotion', u'depressed', 'literal', '', '', 1, u'2014-05-09T15:32:36.686+01:00', u'location', u'pub', 'literal', '', '', 2]
CONN    DEBUG   2014-05-09 15:32:41,468 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore check_err_cb, failure: [Failure instance: Traceback: <class 'psycopg2.DataError'>: value "1304288451229619761" is out of range for type integer
CONTEXT:  PL/pgSQL function wb_get_triple_id(text,text,text,object_type,character varying,character varying) line 8 at SQL statement

/Users/dmrust/git/indx/lib/indx/object_diff.py:113:run_querylist
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:303:execute
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:332:_doit
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:141:poll
--- <exception caught here> ---
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:168:continuePolling
]
CONN    ERROR   2014-05-09 15:32:41,469 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Objectstore update err_cb, failure: [Failure instance: Traceback: <class 'psycopg2.DataError'>: value "1304288451229619761" is out of range for type integer
CONTEXT:  PL/pgSQL function wb_get_triple_id(text,text,text,object_type,character varying,character varying) line 8 at SQL statement

/Users/dmrust/git/indx/lib/indx/object_diff.py:113:run_querylist
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:303:execute
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:332:_doit
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:141:poll
--- <exception caught here> ---
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:168:continuePolling
]
CONN    ERROR   2014-05-09 15:32:41,470 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  BoxHandler do_PUT handle_add_error: [Failure instance: Traceback: <class 'psycopg2.DataError'>: value "1304288451229619761" is out of range for type integer
CONTEXT:  PL/pgSQL function wb_get_triple_id(text,text,text,object_type,character varying,character varying) line 8 at SQL statement

/Users/dmrust/git/indx/lib/indx/object_diff.py:113:run_querylist
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:303:execute
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:332:_doit
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:141:poll
--- <exception caught here> ---
/Users/dmrust/git/indx/env/lib/python2.7/site-packages/txpostgres/txpostgres.py:168:continuePolling
]
CONN    ERROR   2014-05-09 15:32:41,470 REQ:4513319104  TOKEN:c67d5ea6-d786-11e3-9148-28cfe914080b  Exception trying to add to store: value "1304288451229619761" is out of range for type integer
CONTEXT:  PL/pgSQL function wb_get_triple_id(text,text,text,object_type,character varying,character varying) line 8 at SQL statement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions