Title: Redis online store fails to maintain event-time ordering in batch writes · Issue #5163 · feast-dev/feast · GitHub
Open Graph Title: Redis online store fails to maintain event-time ordering in batch writes · Issue #5163 · feast-dev/feast
X Title: Redis online store fails to maintain event-time ordering in batch writes · Issue #5163 · feast-dev/feast
Description: Expected Behavior When writing a batch of events to Redis online store, the store should maintain event-time ordering guarantees regardless of the order of events within the batch. The value associated with the latest timestamp should be...
Open Graph Description: Expected Behavior When writing a batch of events to Redis online store, the store should maintain event-time ordering guarantees regardless of the order of events within the batch. The value associ...
X Description: Expected Behavior When writing a batch of events to Redis online store, the store should maintain event-time ordering guarantees regardless of the order of events within the batch. The value associ...
Opengraph URL: https://github.com/feast-dev/feast/issues/5163
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Redis online store fails to maintain event-time ordering in batch writes","articleBody":"## Expected Behavior \nWhen writing a batch of events to Redis online store, the store should maintain event-time ordering guarantees regardless of the order of events within the batch. The value associated with the latest timestamp should be preserved, even if it appears earlier in the batch.\n\n## Current Behavior\nThe Redis online store processes events in batch order rather than timestamp order. When writing a batch containing events in reverse chronological order (e.g., [t3, t2, t1]), it incorrectly skips later events because it compares timestamps sequentially, causing the wrong values to be stored.\n\n## Steps to reproduce\n```python\nt1 = datetime.now(timezone.utc)\nt2 = t1 + timedelta(seconds=5)\nt3 = t2 + timedelta(seconds=5)\n\n# Create batch with reverse chronological order\ntest_data = pd.DataFrame({\n \"customer_id\": [1] * 3,\n \"total_purchases\": [30, 20, 10],\n \"avg_order_value\": [300.0, 200.0, 100.0],\n \"event_timestamp\": [t3, t2, t1] # Latest timestamp first\n})\n\n# Push batch to online store\nfeature_store.push_features(feature_group_name, test_data, mode=\"online\")\n\n# Retrieve feature - will return value 10 instead of expected 30\nresult = feature_store.get_online_features(...)\n```\n### Specifications\n\n- Version: `Feast SDK Version: \"0.40.1\"`\n- Platform: Any\n- Subsystem: Redis Online Store\n\n## Possible Solution\nIn online_write_batch, before processing the batch:\nSort the data list by timestamp in ascending order, OR\nFind the latest timestamp for each entity key and only write that record\nThe current implementation in online_write_batch processes records sequentially and skips records with timestamps older than what's already been processed in the current batch, which leads to incorrect behavior when events are not in chronological order.\nRelevant code: https://github.com/feast-dev/feast/blob/master/sdk/python/feast/infra/online_stores/redis.py#L582","author":{"url":"https://github.com/sundeep-sf","@type":"Person","name":"sundeep-sf"},"datePublished":"2025-03-19T04:03:29Z","url":"https://github.com/feast-dev/feast/issues/5163"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:801bbd08-1cc3-9605-e53b-56aa5f235310 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8C4:403FE:2D9A30:3F0E37:6AFE982E |
| html-safe-nonce | 54a700ce28dbd81d7cf66ce522a247e3365a1ef2a679f7c25fbb6a2807d285dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEM0OjQwM0ZFOjJEOUEzMDozRjBFMzc6NkFGRTk4MkUiLCJ2aXNpdG9yX2lkIjoiMTg0MjI4NjM0NDY0MjkyNjYzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5600c6a912be22053c6c85bbdd050fcabbc08d43a61a8ce25dee3e2529ed7690 |
| hovercard-subject-tag | issue:2930385712 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/5163/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b81f6d473f83220f3e3995535800e97ffb46463c72f09724707e8fb29c6166ee/feast-dev/feast/issues/5163 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b81f6d473f83220f3e3995535800e97ffb46463c72f09724707e8fb29c6166ee/feast-dev/feast/issues/5163 |
| og:image:alt | Expected Behavior When writing a batch of events to Redis online store, the store should maintain event-time ordering guarantees regardless of the order of events within the batch. The value associ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sundeep-sf |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width