yugabyte-db icon indicating copy to clipboard operation
yugabyte-db copied to clipboard

[YSQL] Long running Index Build fails with "Snapshot too old" errors

Open deeps1991 opened this issue 2 years ago • 1 comments

Jira Link: DB-2965

Description

When a customer tried to create an index on a ~3.3G table via non-concurrent index build, it failed with the following error:

ERROR:  Snapshot too old: Snapshot too old. Read point: { physical: 1657826443976925 }, earliest read time allowed: { physical: 1657830577065449 }, delta (usec): 4133088524: kSnapshotTooOld

This is because, for bigger tables, the index building process can run longer than timestamp_history_retention_interval_sec, which could cause the process to fail, as data gets purged from the main table and cannot be read at the chosen time T.

Opening this ticket to explore if something better & automatic can be done here to automatically expand history retention for long running nonconcurrent index build.

deeps1991 avatar Jul 15 '22 17:07 deeps1991