diff --git a/src/rgw/driver/sfs/sqlite/errors.cc b/src/rgw/driver/sfs/sqlite/errors.cc index e3b67002797fe..7440d528f6c03 100644 --- a/src/rgw/driver/sfs/sqlite/errors.cc +++ b/src/rgw/driver/sfs/sqlite/errors.cc @@ -42,4 +42,16 @@ bool critical_error(int ec) { } } +bool busy_error(int ec) { + switch (ec) { + case SQLITE_BUSY: + case SQLITE_BUSY_RECOVERY: + case SQLITE_BUSY_SNAPSHOT: + case SQLITE_LOCKED: + return true; + default: + return false; + } +} + } // namespace rgw::sal::sfs::sqlite diff --git a/src/rgw/driver/sfs/sqlite/errors.h b/src/rgw/driver/sfs/sqlite/errors.h index f430ee8a8cbf7..6fa87fe8ff8c0 100644 --- a/src/rgw/driver/sfs/sqlite/errors.h +++ b/src/rgw/driver/sfs/sqlite/errors.h @@ -16,5 +16,6 @@ namespace rgw::sal::sfs::sqlite { bool critical_error(int ec); +bool busy_error(int ec); -} +} // namespace rgw::sal::sfs::sqlite