Problem: backlog_reassign_delay is defunct but still listed (#2332)

* Fixed 2 PEP257 compliance errors

* Upgrade Tendermint to 0.19.7 except for Docker image, which is still at 0.19.2

* Problem: backlog_reassign_delay is defunct but still listed

Solution: remove all mentions of & calls for backlog_reassign_delay
This commit is contained in:
Troy McConaghy 2018-06-04 12:19:24 +02:00 committed by Zachary Bowen
parent 1753a7019b
commit 241db4ee48
12 changed files with 4 additions and 48 deletions

View File

@ -106,7 +106,6 @@ config = {
'private': None, 'private': None,
}, },
'keyring': [], 'keyring': [],
'backlog_reassign_delay': 120,
'log': { 'log': {
'file': log_config['handlers']['file']['filename'], 'file': log_config['handlers']['file']['filename'],
'error_file': log_config['handlers']['errors']['filename'], 'error_file': log_config['handlers']['errors']['filename'],

View File

@ -83,10 +83,6 @@ def run_configure(args):
val = conf['database'][key] val = conf['database'][key]
conf['database'][key] = input_on_stderr('Database {}? (default `{}`): '.format(key, val), val) conf['database'][key] = input_on_stderr('Database {}? (default `{}`): '.format(key, val), val)
val = conf['backlog_reassign_delay']
conf['backlog_reassign_delay'] = input_on_stderr(
'Stale transaction reassignment delay (in seconds)? (default `{}`): '.format(val), val)
if config_path != '-': if config_path != '-':
bigchaindb.config_utils.write_config(conf, config_path) bigchaindb.config_utils.write_config(conf, config_path)
else: else:

View File

@ -30,7 +30,7 @@ class Bigchain(object):
TX_IN_BACKLOG = 'backlog' TX_IN_BACKLOG = 'backlog'
"""return if transaction is in backlog""" """return if transaction is in backlog"""
def __init__(self, public_key=None, private_key=None, keyring=[], connection=None, backlog_reassign_delay=None): def __init__(self, public_key=None, private_key=None, keyring=[], connection=None):
"""Initialize the Bigchain instance """Initialize the Bigchain instance
A Bigchain instance has several configuration parameters (e.g. host). A Bigchain instance has several configuration parameters (e.g. host).
@ -56,10 +56,6 @@ class Bigchain(object):
self.me_private = private_key or bigchaindb.config['keypair']['private'] self.me_private = private_key or bigchaindb.config['keypair']['private']
self.nodes_except_me = keyring or bigchaindb.config['keyring'] self.nodes_except_me = keyring or bigchaindb.config['keyring']
if backlog_reassign_delay is None:
backlog_reassign_delay = bigchaindb.config['backlog_reassign_delay']
self.backlog_reassign_delay = backlog_reassign_delay
consensusPlugin = bigchaindb.config.get('consensus_plugin') consensusPlugin = bigchaindb.config.get('consensus_plugin')
if consensusPlugin: if consensusPlugin:
@ -140,7 +136,7 @@ class Bigchain(object):
backlog after some amount of time specified in the configuration backlog after some amount of time specified in the configuration
""" """
return backend.query.get_stale_transactions(self.connection, self.backlog_reassign_delay) return backend.query.get_stale_transactions(self.connection)
def validate_transaction(self, transaction): def validate_transaction(self, transaction):
"""Validate a transaction. """Validate a transaction.

View File

@ -24,7 +24,6 @@ For convenience, here's a list of all the relevant environment variables (docume
`BIGCHAINDB_WSSERVER_ADVERTISED_HOST`<br> `BIGCHAINDB_WSSERVER_ADVERTISED_HOST`<br>
`BIGCHAINDB_WSSERVER_ADVERTISED_PORT`<br> `BIGCHAINDB_WSSERVER_ADVERTISED_PORT`<br>
`BIGCHAINDB_CONFIG_PATH`<br> `BIGCHAINDB_CONFIG_PATH`<br>
`BIGCHAINDB_BACKLOG_REASSIGN_DELAY`<br>
`BIGCHAINDB_LOG`<br> `BIGCHAINDB_LOG`<br>
`BIGCHAINDB_LOG_FILE`<br> `BIGCHAINDB_LOG_FILE`<br>
`BIGCHAINDB_LOG_ERROR_FILE`<br> `BIGCHAINDB_LOG_ERROR_FILE`<br>
@ -201,21 +200,6 @@ export BIGCHAINDB_WSSERVER_ADVERTISED_PORT=443
} }
``` ```
## backlog_reassign_delay
Specifies how long, in seconds, transactions can remain in the backlog before being reassigned. Long-waiting transactions must be reassigned because the assigned node may no longer be responsive. The default duration is 120 seconds.
**Example using environment variables**
```text
export BIGCHAINDB_BACKLOG_REASSIGN_DELAY=30
```
**Default value (from a config file)**
```js
"backlog_reassign_delay": 120
```
## log ## log
The `log` key is expected to point to a mapping (set of key/value pairs) The `log` key is expected to point to a mapping (set of key/value pairs)

View File

@ -206,11 +206,6 @@ spec:
configMapKeyRef: configMapKeyRef:
name: vars name: vars
key: bigchaindb-wsserver-advertised-scheme key: bigchaindb-wsserver-advertised-scheme
- name: BIGCHAINDB_BACKLOG_REASSIGN_DELAY
valueFrom:
configMapKeyRef:
name: bdb-config
key: bigchaindb-backlog-reassign-delay
- name: BIGCHAINDB_DATABASE_MAXTRIES - name: BIGCHAINDB_DATABASE_MAXTRIES
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:

View File

@ -106,10 +106,6 @@ data:
# BigchainDB instance authentication user name # BigchainDB instance authentication user name
bdb-user: "<user name>" bdb-user: "<user name>"
# bigchaindb-backlog-reassign-delay is the number of seconds a transaction
# can remain in the backlog before being reassigned.
bigchaindb-backlog-reassign-delay: "120"
# bigchaindb-database-maxtries is the maximum number of times that BigchainDB # bigchaindb-database-maxtries is the maximum number of times that BigchainDB
# will try to establish a connection with the database backend. # will try to establish a connection with the database backend.
# If it is set to 0, then it will try forever. # If it is set to 0, then it will try forever.

View File

@ -59,8 +59,6 @@ spec:
value: "EEWUAhsk94ZUHhVw7qx9oZiXYDAWc9cRz93eMrsTG4kZ" value: "EEWUAhsk94ZUHhVw7qx9oZiXYDAWc9cRz93eMrsTG4kZ"
- name: BIGCHAINDB_KEYPAIR_PRIVATE - name: BIGCHAINDB_KEYPAIR_PRIVATE
value: "3CjmRhu718gT1Wkba3LfdqX5pfYuBdaMPLd7ENUga5dm" value: "3CjmRhu718gT1Wkba3LfdqX5pfYuBdaMPLd7ENUga5dm"
- name: BIGCHAINDB_BACKLOG_REASSIGN_DELAY
value: "120"
- name: BIGCHAINDB_DATABASE_MAXTRIES - name: BIGCHAINDB_DATABASE_MAXTRIES
value: "3" value: "3"
- name: BIGCHAINDB_DATABASE_CONNECTION_TIMEOUT - name: BIGCHAINDB_DATABASE_CONNECTION_TIMEOUT

View File

@ -339,10 +339,6 @@ data:
# BigchainDB instance authentication user name # BigchainDB instance authentication user name
bdb-user: "${bdb_user}" bdb-user: "${bdb_user}"
# bigchaindb-backlog-reassign-delay is the number of seconds a transaction
# can remain in the backlog before being reassigned.
bigchaindb-backlog-reassign-delay: "120"
# bigchaindb-database-maxtries is the maximum number of times that BigchainDB # bigchaindb-database-maxtries is the maximum number of times that BigchainDB
# will try to establish a connection with the database backend. # will try to establish a connection with the database backend.
# If it is set to 0, then it will try forever. # If it is set to 0, then it will try forever.

View File

@ -37,7 +37,6 @@ def mock_bigchaindb_backup_config(monkeypatch):
config = { config = {
'keypair': {}, 'keypair': {},
'database': {'host': 'host', 'port': 12345, 'name': 'adbname'}, 'database': {'host': 'host', 'port': 12345, 'name': 'adbname'},
'backlog_reassign_delay': 5
} }
monkeypatch.setattr('bigchaindb._config', config) monkeypatch.setattr('bigchaindb._config', config)

View File

@ -543,7 +543,7 @@ class TestBigchainApi(object):
b.write_transaction(tx) b.write_transaction(tx)
# retrieve the transaction # retrieve the transaction
response = list(query.get_stale_transactions(b.connection, 0))[0] response = list(query.get_stale_transactions(b.connection))[0]
# check if the assignee is the current node # check if the assignee is the current node
assert response['assignee'] == b.me assert response['assignee'] == b.me
@ -570,7 +570,7 @@ class TestBigchainApi(object):
b.write_transaction(tx) b.write_transaction(tx)
# retrieve the transaction # retrieve the transaction
response = query.get_stale_transactions(b.connection, 0) response = query.get_stale_transactions(b.connection)
# check if the assignee is one of the _other_ federation nodes # check if the assignee is one of the _other_ federation nodes
for tx in response: for tx in response:

View File

@ -170,7 +170,6 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch, request, ssl_con
'database': { 'database': {
'host': DATABASE_HOST 'host': DATABASE_HOST
}, },
'backlog_reassign_delay': 5,
'log': { 'log': {
'level_console': 'debug', 'level_console': 'debug',
}, },
@ -290,7 +289,6 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch, request, ssl_con
'private': None, 'private': None,
}, },
'keyring': KEYRING.split(':'), 'keyring': KEYRING.split(':'),
'backlog_reassign_delay': 5,
'log': { 'log': {
'file': LOG_FILE, 'file': LOG_FILE,
'error_file': log_config['handlers']['errors']['filename'], 'error_file': log_config['handlers']['errors']['filename'],

View File

@ -23,7 +23,6 @@ def config(request, monkeypatch):
}, },
'keyring': [], 'keyring': [],
'CONFIGURED': True, 'CONFIGURED': True,
'backlog_reassign_delay': 30,
} }
monkeypatch.setattr('bigchaindb.config', config) monkeypatch.setattr('bigchaindb.config', config)