Skip to content

Commit

Permalink
Merge branch 'release/2.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebdah committed Aug 10, 2017
2 parents 3014cf0 + 09d774c commit 712eb95
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/configuration_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ increase-consumed-writes-scale ``dict``

Detailed information on the scale dict can be found `here <http://dynamic-dynamodb.readthedocs.org/en/latest/granular_scaling.html>`__.

If this is specified it will override ``increase-consumed-reads-with``
If this is specified it will override ``increase-consumed-writes-with``
increase-reads-unit ``str`` ``percent`` Set if we should scale up reads in ``units`` or ``percent``
increase-reads-with ``int`` 50 Number of ``units`` or ``percent`` we should scale up the read provisioning with. Choose entity with ``increase-reads-unit``.
increase-throttled-by-consumed-reads-unit ``str`` ``increase-reads-unit`` Set if we should scale up reads based on throttled events with respect to consumption in ``units`` or ``percent``
Expand Down
10 changes: 10 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Release notes
=============

2.5.0
-----

**Release date** 2017-08-10

- Prevents scaling down write capacity as long as there are throttled write requests (`#319 <https://github.com/sebdah/dynamic-dynamodb/pull/319>`__).
- Print GSI changes as integers instead of floats (`#323 <https://github.com/sebdah/dynamic-dynamodb/pull/323>`__).
- Log table name together with the GSI name for uniqueness (`#331 <https://github.com/sebdah/dynamic-dynamodb/pull/331>`__).
- Documentation fixes (`#329 <https://github.com/sebdah/dynamic-dynamodb/pull/329>`__)

2.4.0
-----

Expand Down
7 changes: 4 additions & 3 deletions dynamic_dynamodb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,16 @@ def execute():
sys.exit(1)

for gsi_name, gsi_key in sorted(gsi_names):
unique_gsi_name = ':'.join([table_name, gsi_name])
try:
gsi_num_consec_read_checks = \
CHECK_STATUS['gsis'][gsi_name]['reads']
CHECK_STATUS['gsis'][unique_gsi_name]['reads']
except KeyError:
gsi_num_consec_read_checks = 0

try:
gsi_num_consec_write_checks = \
CHECK_STATUS['gsis'][gsi_name]['writes']
CHECK_STATUS['gsis'][unique_gsi_name]['writes']
except KeyError:
gsi_num_consec_write_checks = 0

Expand All @@ -186,7 +187,7 @@ def execute():
gsi_num_consec_read_checks,
gsi_num_consec_write_checks)

CHECK_STATUS['gsis'][gsi_name] = {
CHECK_STATUS['gsis'][unique_gsi_name] = {
'reads': gsi_num_consec_read_checks,
'writes': gsi_num_consec_write_checks
}
Expand Down
4 changes: 2 additions & 2 deletions dynamic_dynamodb/core/gsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def ensure_provisioning(
# Handle throughput updates
if read_update_needed or write_update_needed:
logger.info(
'{0} - GSI: {1} - Changing provisioning to {2:f} '
'read units and {3:f} write units'.format(
'{0} - GSI: {1} - Changing provisioning to {2:d} '
'read units and {3:d} write units'.format(
table_name,
gsi_name,
int(updated_read_units),
Expand Down
6 changes: 6 additions & 0 deletions dynamic_dynamodb/core/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,12 @@ def __ensure_provisioning_writes(
'{0} - Down scaling event detected. No action taken as scaling'
' down writes is not done when usage is at 0%'.format(
table_name))
# Exit if writes are still throttled
elif (throttled_writes_upper_threshold
and throttled_write_count > throttled_writes_upper_threshold):
logger.info(
'{0} - Down scaling event detected. No action taken as there'
' are still throttled writes'.format(table_name))
else:
if consumed_calculated_provisioning:
if decrease_consumed_writes_unit == 'percent':
Expand Down
2 changes: 1 addition & 1 deletion dynamic_dynamodb/dynamic-dynamodb.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[general]
version: 2.4.0
version: 2.5.0

0 comments on commit 712eb95

Please sign in to comment.