Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/AWS/Shared/Storage/DynamoDBStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,10 @@ private async ValueTask<TableDescription> TableUpdateTtlAsync(TableDescription t
// This is because updating the TTL attribute requires (1) disabling the table TTL and (2) re-enabling it with the new TTL attribute.
// As per the below details page for this API: "It can take up to one hour for the change to fully process. Any additional UpdateTimeToLive calls for the same table during this one hour duration result in a ValidationException."
// https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTimeToLive.html
if (describeTimeToLive.TimeToLiveStatus != TimeToLiveStatus.DISABLED)
// However if the TTL is already set on the correct attribute, the attribute value is updated every time a record is written, thus the configuration is already correct and warning doesn't need to be logged.
if (describeTimeToLive.TimeToLiveStatus != TimeToLiveStatus.DISABLED && describeTimeToLive.AttributeName != ttlAttributeName)
{
LogErrorTtlNotDisabled(_logger, tableDescription.TableName);
LogWarningTtlNotDisabled(_logger, tableDescription.TableName);
return tableDescription;
}

Expand Down Expand Up @@ -989,10 +990,10 @@ private readonly struct DictionaryLogRecord(Dictionary<string, AttributeValue> d
private static partial void LogErrorCouldNotUpdateTable(ILogger logger, Exception exception, string tableName);

[LoggerMessage(
Level = LogLevel.Error,
Level = LogLevel.Warning,
Message = "TTL is not DISABLED. Cannot update table TTL for table {TableName}. Please update manually."
)]
private static partial void LogErrorTtlNotDisabled(ILogger logger, string tableName);
private static partial void LogWarningTtlNotDisabled(ILogger logger, string tableName);

[LoggerMessage(
Level = LogLevel.Error,
Expand Down
Loading