Commit b7ae488
authored
feat(server): Remote Materialization (#6649)
* feat(server): Add async materialization via ?async=true query param
When ?async=true is passed to /materialize and /materialize-incremental,
the endpoint fires off materialization in a background thread and returns
202 Accepted immediately. Concurrent requests for an already-MATERIALIZING
FV are rejected with 409. Without ?async=true, behavior is unchanged.
Client-side additions:
- remote=True param on store.materialize() / materialize_incremental()
to delegate to the feature server (URL/TLS from online_store config)
- wait=False support with store.poll_materialization() for status polling
- FeatureView state set to MATERIALIZING before 202, reset on failure
Server-side additions:
- ?async=true on existing /materialize and /materialize-incremental
- ?force=true to override stuck MATERIALIZING state
- Four module-level helpers for testability:
_authorize_materialize_views, _check_already_materializing,
_update_fv_state, _parse_materialize_timestamps
Registry fixes:
- SQL and Snowflake registries now set FV state to AVAILABLE_ONLINE
in apply_materialization() (parity with file-based registry)
Addresses #4526
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
* feat(server): Add async materialization via ?async=true query param
When ?async=true is passed to /materialize and /materialize-incremental,
the endpoint fires off materialization in a background thread and returns
202 Accepted immediately. Concurrent requests for an already-MATERIALIZING
FV are rejected with 409. Without ?async=true, behavior is unchanged.
Client-side additions:
- remote=True param on store.materialize() / materialize_incremental()
to delegate to the feature server (URL/TLS from online_store config)
- wait=False support with store.poll_materialization() for status polling
- FeatureView state set to MATERIALIZING before 202, reset on failure
Server-side additions:
- ?async=true on existing /materialize and /materialize-incremental
- ?force=true to override stuck MATERIALIZING state
- Four module-level helpers for testability:
_authorize_materialize_views, _check_already_materializing,
_update_fv_state, _parse_materialize_timestamps
Registry fixes:
- SQL and Snowflake registries now set FV state to AVAILABLE_ONLINE
in apply_materialization() (parity with file-based registry)
Addresses #4526
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
* feat(sdk): Auto-delegate materialize to feature server when online_store is remote
When online_store.type == remote, materialize() and materialize_incremental()
POST to the feature server with ?async=true (fire-and-forget) instead of
running the engine locally. Optional force=True maps to ?force=true for
stuck MATERIALIZING recovery. URL/TLS/auth come from online_store config.
Shared _delegate_remote_materialize() builds query params and posts;
RemoteComputeEngine remains a follow-up for provider-layer remoting.
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
* fix(server): Let store own MATERIALIZING transitions on async path
Remove server-side MATERIALIZING pre-set before 202 which conflicted with
store.materialize() state machine (MATERIALIZING → MATERIALIZING rejected).
Async now accepts and runs materialize in the background; store owns
transitions. ?force=true resets stuck MATERIALIZING FVs to GENERATED so
normal materialize can proceed.
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
* fix: Address #6649 review — run_async, race reserve, version threading
- Revert FeatureView.state from __eq__
- Add run_async for remote sync vs async HTTP
- Reserve MATERIALIZING before 202; idempotent store transitions
- Thread version through authorize and all materialize server paths
- Narrow silent excepts; document version on request models
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
* fix(server): Only reset MATERIALIZING FVs on async materialize failure
Avoid wiping AVAILABLE_ONLINE when a post-success exception fires
(e.g. SparkApp CR already cleaned up). Reuse the stuck-state helper
so true failures still return to GENERATED.
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
* fix: Default run_async to False and cover version forwarding
Preserve sync semantics for remote users; opt into fire-and-forget
with run_async=True. Add unit tests that version is threaded through
authorize and both sync/async materialize server paths.
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
* fix(server): Use dedicated executor for async materialize
Isolate long materialize waits from the default/shared thread pool
used by online serving. Pool size via FEAST_MATERIALIZE_MAX_WORKERS
(default 2); shut down on app lifespan exit without blocking.
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>
---------
Signed-off-by: Aniket Paluskar <apaluska@redhat.com>1 parent e8edab5 commit b7ae488
5 files changed
Lines changed: 619 additions & 58 deletions
File tree
- sdk/python
- feast
- infra/registry
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
97 | 107 | | |
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
102 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
103 | 120 | | |
104 | 121 | | |
105 | 122 | | |
| |||
333 | 350 | | |
334 | 351 | | |
335 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
336 | 475 | | |
337 | 476 | | |
338 | 477 | | |
| |||
412 | 551 | | |
413 | 552 | | |
414 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
415 | 570 | | |
416 | 571 | | |
417 | 572 | | |
| |||
445 | 600 | | |
446 | 601 | | |
447 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
448 | 606 | | |
449 | 607 | | |
450 | 608 | | |
| |||
798 | 956 | | |
799 | 957 | | |
800 | 958 | | |
801 | | - | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
802 | 964 | | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
819 | 969 | | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
831 | 1006 | | |
832 | 1007 | | |
833 | 1008 | | |
834 | 1009 | | |
835 | 1010 | | |
836 | | - | |
| 1011 | + | |
837 | 1012 | | |
838 | 1013 | | |
| 1014 | + | |
839 | 1015 | | |
840 | 1016 | | |
841 | 1017 | | |
842 | | - | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
843 | 1023 | | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
854 | 1060 | | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
| 1061 | + | |
860 | 1062 | | |
861 | 1063 | | |
862 | | - | |
863 | | - | |
| 1064 | + | |
| 1065 | + | |
864 | 1066 | | |
| 1067 | + | |
865 | 1068 | | |
866 | 1069 | | |
867 | 1070 | | |
| |||
0 commit comments