DynamoDBStreams GetRecords with --limit returns 空记录

DynamoDBStreams GetRecords with --limit returns empty records

我正在尝试 运行 带 --limit 选项的 DynamoDBStreams GetRecords 命令,但未返回任何内容...

$ aws --version
aws-cli/1.16.266 Python/3.5.2 Linux/5.3.0-28-generic botocore/1.13.2


$ aws dynamodbstreams --profile my-profile --region my-region get-records --shard-iterator my-shard-iterator --limit 2
# Output
{
    "NextShardIterator": "my-next-shard-iterator",
    "Records": []
}

当我删除 --limit 选项时,返回了一些记录:

$ aws dynamodbstreams --profile my-profile --region my-region get-records --shard-iterator my-shard-iterator
# Output
{
    "Records": [
          {
             # record 1
          },
          {
             # record 2
          }
     ],
    "NextShardIterator": "my-next-shard-iterator"
}

根据documentation

--limit (integer) The maximum number of records to return from the shard. The upper limit is 1000.

我是不是做错了什么或者这个选项在全球范围内不起作用?

谢谢

--limit 似乎有效。但是从正确的分片迭代器中检索记录有点长。

我也是这样。

我在下一个分片迭代器的 API 响应中得到 0 条记录。我再次尝试这个分片迭代器并请求记录。它可能会或可能不会响应记录。有时我必须这样做 500 次才能获得一条记录。我想了解的是我们需要执行多少次才能完全从分片中读取数据。

来自AWS doc

Specify a shard iterator using the ShardIterator parameter. The shard iterator specifies the position in the shard from which you want to start reading stream records sequentially. If there are no stream records available in the portion of the shard that the iterator points to, GetRecords returns an empty list. Note that it might take multiple calls to get to a portion of the shard that contains stream records.

检查上面语句中的粗体注释。这是什么意思?