Repository navigation
Commit 8bcb5aa
committed
fix: Retry BigQuery entity table expiration on stale etag
The BigQuery offline store sets a 30-minute expiration on the temporary
entity table it uploads by calling client.get_table() followed by
client.update_table(table, ["expires"]). update_table sends a
conditional PATCH keyed on the etag returned by get_table().
Shortly after the job that creates the table completes, BigQuery can
still be asynchronously finalizing the table's metadata (e.g. row
counts, last modified time), which changes its etag server-side. If
that happens between get_table() and update_table(), the PATCH is
rejected with a PreconditionFailed (412, "did not meet condition
IF_MATCH"), even though the upload itself succeeded. Because this is
a table metadata PATCH rather than a BigQuery job, the failure leaves
no trace in the BigQuery Jobs Explorer, making it look spurious and
hard to diagnose from the GCP console.
Extract the expiration logic into _set_table_expiration() and retry
it on PreconditionFailed, refetching the table for a fresh etag
before each retry.
Signed-off-by: Luis Silva <58522514+luisSilva1234@users.noreply.github.com>1 parent a291a0f commit 8bcb5aa
2 files changed
Lines changed: 90 additions & 5 deletions
File tree
- sdk/python
- feast/infra/offline_stores
- tests/unit/infra/offline_stores
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| |||
1531 | 1537 | | |
1532 | 1538 | | |
1533 | 1539 | | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
| 1540 | + | |
1537 | 1541 | | |
1538 | 1542 | | |
1539 | 1543 | | |
1540 | 1544 | | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
1541 | 1573 | | |
1542 | 1574 | | |
1543 | 1575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
253 | 306 | | |
254 | 307 | | |
255 | 308 | | |
| |||
0 commit comments