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

Deleting a transaction type with pending transactions of that type causes transaction processor to fail #246

Open
cheeseandcereal opened this issue Nov 18, 2019 · 0 comments

Comments

@cheeseandcereal
Copy link
Contributor

  • Dragonchain Version: 4.1.0
  • Entrypoint: tx_processor

Deleting a transaction type is basically an instantaneous operation, and if there are transactions in the pending queue of that type which are not processed, the transaction processor will crash when trying to index:

[L1] Starting processing for block 28372715.
[L1] Signing complete
[L1] Next block created. Previous block hash: MEUCIQD3KXrMSYCzsO/X16FB1pOKjcr1NIDFLklGfTNpmuWAnwIgZwqSPZTIKmzWPSFmmC3t5Ho3eFyoClLsJr4X/0S1zjk=, previous block ID: 28325005
[L1] Signing block
[L1] Stripping payloads and signing
[L1] Signing block...
[L1] Extracting custom indexes from transactions
Attempting to get type queryTesting
Attempting to get type testingType1
Attempting to get type test-blocks
Attempting to get type banana_salad
Attempting to get type contractType1
[L1] Uploading full transactions
[TRANSACTION DAO] Putting transaction to storage
Job "execute (trigger: cron[second='*/5'], next run at: 2019-11-18 18:30:00 UTC)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/apscheduler/executors/base.py", line 125, in run_job
    retval = job.func(*job.args, **job.kwargs)
  File "/usr/src/core/dragonchain/transaction_processor/level_1_actions.py", line 73, in execute
    store_data(block)
  File "/usr/src/core/dragonchain/transaction_processor/level_1_actions.py", line 173, in store_data
    transaction_dao.store_full_txns(block)
  File "/usr/src/core/dragonchain/lib/dao/transaction_dao.py", line 84, in store_full_txns
    redisearch.put_many_documents(key, value, upsert=True)
  File "/usr/src/core/dragonchain/lib/database/redisearch.py", line 281, in put_many_documents
    batch_indexer.commit()
  File "/usr/local/lib/python3.8/site-packages/redisearch/client.py", line 153, in commit
    self.pipeline.execute()
  File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 3691, in execute
    return execute(conn, stack, raise_on_error)
  File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 3633, in _execute_pipeline
    self.raise_first_error(commands, response)
  File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 3640, in raise_first_error
    raise r
  File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 3628, in _execute_pipeline
    self.parse_response(connection, args[0], **options))
  File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 3649, in parse_response
    result = Redis.parse_response(
  File "/usr/local/lib/python3.8/site-packages/redis/client.py", line 853, in parse_response
    response = connection.read_response()
  File "/usr/local/lib/python3.8/site-packages/redis/connection.py", line 718, in read_response
    raise response
redis.exceptions.ResponseError: Command # 1 (FT.ADD testingType1 1ea74dd4-a92a-4a14-a10b-f41f78443226 1.0 REPLACE FIELDS timestamp 1573863248 tag  block_id 28372715) of pipeline caused error: Unknown index name

Expected behavior is that if the transaction type doesn't exist, it should still include the transaction, but simply not perform this index.

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

No branches or pull requests

1 participant