Skip to content

Commit 8d0aaa5

Browse files
committed
Adding warning about retry operation
1 parent 3561c66 commit 8d0aaa5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/content/docs/d1/observability/debug-d1.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ The following table lists specific instances of `D1_ERROR`.
5454

5555
<Example title="List of D1_ERRORs">
5656

57+
:::caution[Retry operations]
58+
While some D1 errors can be resolved by retrying the operation, retrying is only safe if your query is idempotent (produces the same result when executed multiple times).
59+
60+
Before retrying any failed operation:
61+
- Verify your query is idempotent
62+
- Avoid retrying non-idempotent operations
63+
- Consider implementing application-level safeguards
64+
65+
When in doubt, do not retry automatically. Instead, investigate the root cause and ensure your application logic can handle potential duplicates safely.
66+
:::
67+
5768
| `D1_ERROR` type | Description | Recommended action |
5869
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
5970
| `D1 DB reset because its code was updated.` | Cloudflare has updated the code for D1 (or the underlying Durable Object), and the Durable Object which contains the D1 database is restarting. | Retry the operation. |

0 commit comments

Comments
 (0)