Skip to content

Commit 1ec7a94

Browse files
committed
Handle on-demand tables
1 parent 0fbb432 commit 1ec7a94

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

replicate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (state *syncState) copyTable(key primaryKey) error {
9090
srcDynamo := state.srcDynamo
9191
dstDynamo := state.dstDynamo
9292

93-
if state.tableConfig.ReadQps > sourceCapacity.readCapacity {
93+
if sourceCapacity.readCapacity != 0 && state.tableConfig.ReadQps > sourceCapacity.readCapacity {
9494
newCapacity := provisionedThroughput{
9595
state.tableConfig.ReadQps,
9696
sourceCapacity.writeCapacity,
@@ -104,7 +104,7 @@ func (state *syncState) copyTable(key primaryKey) error {
104104
isSourceThroughputChanged = true
105105
}
106106

107-
if state.tableConfig.WriteQps > dstCapacity.writeCapacity {
107+
if dstCapacity.writeCapacity != 0 && state.tableConfig.WriteQps > dstCapacity.writeCapacity {
108108
newCapacity := provisionedThroughput{
109109
dstCapacity.readCapacity,
110110
state.tableConfig.WriteQps,

table.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,22 +270,22 @@ func (sync *syncState) getCapacity(tableName string, dynamo *dynamodb.DynamoDB)
270270
logger.WithFields(logging.Fields{
271271
"Error": err,
272272
"Table": tableName,
273-
}).Debug("Error in reading provisioned throughput")
273+
}).Error("Error in reading provisioned throughput")
274274
} else {
275275
result := output.Table.ProvisionedThroughput
276276
logger.WithFields(logging.Fields{
277277
"Table": tableName,
278278
"Read Capacity": *result.ReadCapacityUnits,
279279
"Write Capacity": *result.WriteCapacityUnits,
280-
}).Debug("Fetched provisioned throughput of table")
280+
}).Info("Fetched provisioned throughput of table")
281281
return provisionedThroughput{
282282
*result.ReadCapacityUnits,
283283
*result.WriteCapacityUnits,
284284
}
285285
}
286286
}
287287

288-
return provisionedThroughput{0, 0}
288+
return provisionedThroughput{-1, -1}
289289
}
290290

291291
func (sync *syncState) getTableSize(table string, dynamo *dynamodb.DynamoDB) int64 {

0 commit comments

Comments
 (0)