当对 table 的写入触发二级索引行的创建或更新时,这算作回填吗?

When a write to a table triggers a secondary index row to be created or updated, does that count as a backfill?

根据这里的回答

Read/query to the index itself are not allowed during the backfill. But writes to the original table are allowed. New writes are added to the index concurrently. After the backfill, Spanner will make sure only the latest data will be presented when queried.

所以问题是,在回填过程完成后,对索引的更新是否被视为类似的回填保护?

例如:如果我将行 Z 添加到现有的 table 并且 table 有一个辅助索引,该索引已经完成正式的回填过程,我的新行 Z 符合索引的条件,在扳手选择写入到写入索引之前,索引是否处于 backfill 状态?还是回填状态仅在现有 table 的初始索引填充期间?

有可能我们写了一行,然后在该行实际进入索引之前,另一个进程尝试查询索引,该查询是否会因回填错误而停止:

The index <index_name> cannot be used because it is in backfill

So the question is, after the backfill process has completed are updates into the index as they happen treated as a similar backfill guard?

For example: if I add row Z to an existing table and that table has a secondary index that has already completed the formal backfill process where my new row Z qualifies for the index, during the time where spanner picks that write up until the time it's written to the index, is the index considered in that backfill state? Or is that backfill state only during the initial index population on an existing table?

不,回填仅在首次创建索引时发生,并且它仅处理创建时间戳之前的更新。这种为索引中的值设置了一个基线。

此时间戳之后的新更新,无论是在回填完成之前还是之后,都将由正常的索引更新过程处理。注意:在内部 Spanner 确实以稍微不同的方式处理回填期间的更新以避免争用,但这是实现细节。

It's possible that we write a row and then before that row actually lands in the index, another process attempts to query the index, will that query be stopped with the backfill error:

没有。索引的更新与 table 的更新一起提交。在您的示例中,不应该有任何错误,如果读取发生在提交成功之前,reader 将看到旧值,否则将看到新值。