Title: Materialization and serving fail when using Redis cluster for the online store · Issue #2297 · feast-dev/feast · GitHub
Open Graph Title: Materialization and serving fail when using Redis cluster for the online store · Issue #2297 · feast-dev/feast
X Title: Materialization and serving fail when using Redis cluster for the online store · Issue #2297 · feast-dev/feast
Description: Expected Behavior Using a Redis cluster as the online storage should work without errors. Current Behavior Using a Redis cluster as the online storage no longer works after updating from 0.17.0 to 0.18.0. The issue happens whenever Feast...
Open Graph Description: Expected Behavior Using a Redis cluster as the online storage should work without errors. Current Behavior Using a Redis cluster as the online storage no longer works after updating from 0.17.0 to ...
X Description: Expected Behavior Using a Redis cluster as the online storage should work without errors. Current Behavior Using a Redis cluster as the online storage no longer works after updating from 0.17.0 to ...
Opengraph URL: https://github.com/feast-dev/feast/issues/2297
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Materialization and serving fail when using Redis cluster for the online store","articleBody":"## Expected Behavior \r\nUsing a Redis cluster as the online storage should work without errors.\r\n\r\n## Current Behavior\r\nUsing a Redis cluster as the online storage no longer works after updating from 0.17.0 to 0.18.0. The issue happens whenever Feast tries to connect to the Redis cluster - e.g. during `feast materialize` or during feature serving. The exact error that is raised looks like this:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/usr/local/bin/feast\", line 8, in \u003cmodule\u003e\r\n sys.exit(cli())\r\n File \"/usr/local/lib/python3.7/site-packages/click/core.py\", line 1128, in __call__\r\n return self.main(*args, **kwargs)\r\n File \"/usr/local/lib/python3.7/site-packages/click/core.py\", line 1053, in main\r\n rv = self.invoke(ctx)\r\n File \"/usr/local/lib/python3.7/site-packages/click/core.py\", line 1659, in invoke\r\n return _process_result(sub_ctx.command.invoke(sub_ctx))\r\n File \"/usr/local/lib/python3.7/site-packages/click/core.py\", line 1395, in invoke\r\n return ctx.invoke(self.callback, **ctx.params)\r\n File \"/usr/local/lib/python3.7/site-packages/click/core.py\", line 754, in invoke\r\n return __callback(*args, **kwargs)\r\n File \"/usr/local/lib/python3.7/site-packages/click/decorators.py\", line 26, in new_func\r\n return f(get_current_context(), *args, **kwargs)\r\n File \"/usr/local/lib/python3.7/site-packages/feast/cli.py\", line 444, in materialize_command\r\n end_date=utils.make_tzaware(datetime.fromisoformat(end_ts)),\r\n File \"/usr/local/lib/python3.7/site-packages/feast/usage.py\", line 269, in wrapper\r\n return func(*args, **kwargs)\r\n File \"/usr/local/lib/python3.7/site-packages/feast/feature_store.py\", line 1087, in materialize\r\n tqdm_builder=tqdm_builder,\r\n File \"/usr/local/lib/python3.7/site-packages/feast/infra/passthrough_provider.py\", line 168, in materialize_single_feature_view\r\n lambda x: pbar.update(x),\r\n File \"/usr/local/lib/python3.7/site-packages/feast/infra/passthrough_provider.py\", line 86, in online_write_batch\r\n self.online_store.online_write_batch(config, table, data, progress)\r\n File \"/usr/local/lib/python3.7/site-packages/feast/usage.py\", line 280, in wrapper\r\n raise exc.with_traceback(traceback)\r\n File \"/usr/local/lib/python3.7/site-packages/feast/usage.py\", line 269, in wrapper\r\n return func(*args, **kwargs)\r\n File \"/usr/local/lib/python3.7/site-packages/feast/infra/online_stores/redis.py\", line 184, in online_write_batch\r\n client = self._get_client(online_store_config)\r\n File \"/usr/local/lib/python3.7/site-packages/feast/infra/online_stores/redis.py\", line 164, in _get_client\r\n self._client = RedisCluster(**kwargs)\r\n File \"/usr/local/lib/python3.7/site-packages/redis/cluster.py\", line 517, in __init__\r\n **kwargs,\r\n File \"/usr/local/lib/python3.7/site-packages/redis/cluster.py\", line 1125, in __init__\r\n self.populate_startup_nodes(startup_nodes)\r\n File \"/usr/local/lib/python3.7/site-packages/redis/cluster.py\", line 1251, in populate_startup_nodes\r\n self.startup_nodes[n.name] = n\r\nAttributeError: 'dict' object has no attribute 'name'\r\n```\r\n\r\n## Steps to reproduce\r\n- Install Feast version 0.18.0\r\n- Set up a Redis cluster as the online store:\r\n\r\n```yaml\r\nonline_store:\r\n type: redis\r\n redis_type: redis_cluster\r\n connection_string: \"host1:port1,host2:port2,host3:port3\"\r\n```\r\n\r\n- Run `feast materialize`\r\n\r\n### Specifications\r\n\r\n- Version: 0.18.0\r\n- Platform: Linux\r\n\r\n## Possible Solution\r\nSome investigation revealed that versions 0.17.0 and 0.18.0 differ in the sense that 0.18.0 uses `RedisCluster` from `redis.cluster` instead of `rediscluster`. As a result, the code [here](https://github.com/feast-dev/feast/blob/144f25c6dae6dbc4181ffa13fba1714c0baddab3/sdk/python/feast/infra/online_stores/redis.py#L164) breaks because the new `RedisCluster` instance expects to receive a list of `ClusterNode` instead of a list of dicts. Temporarily we worked around this issue by creating a custom online store (by copying all of the code in the linked file 😁 ) and changing it like so:\r\n\r\n```diff\r\n+ from redis.cluster import ClusterNode\r\n\r\n...\r\n\r\n- kwargs[\"startup_nodes\"] = startup_nodes\r\n+ kwargs[\"startup_nodes\"] = [ClusterNode(**node) for node in startup_nodes]\r\n self._client = RedisCluster(**kwargs)\r\n```\r\n\r\nThis worked for us, but I'm not sure if this is the best approach in general because I'm not too familiar with the codebase yet.","author":{"url":"https://github.com/vstrimaitis","@type":"Person","name":"vstrimaitis"},"datePublished":"2022-02-09T15:31:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/2297/feast/issues/2297"}
| 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:2749199c-3240-784d-04e0-abb488a305a4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BDC4:5C832:2D8FEC5:4043E21:69791592 |
| html-safe-nonce | 0c3645385a689fecf7c6414b505ce949dfb639baccb10e264a9d7b83c6f01fe2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREM0OjVDODMyOjJEOEZFQzU6NDA0M0UyMTo2OTc5MTU5MiIsInZpc2l0b3JfaWQiOiI3MzM4NDk3MDkyMTI3MTAyMzU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0cd1111b3dc7a969d33838ebdeacbf9783b034e71e2274f0071b91b3a56d698c |
| hovercard-subject-tag | issue:1128692314 |
| 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/2297/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a56a712a641c626da26ee8a5fecc6e42bfc308dfdc149a0b0ed7a1373d5c0aca/feast-dev/feast/issues/2297 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a56a712a641c626da26ee8a5fecc6e42bfc308dfdc149a0b0ed7a1373d5c0aca/feast-dev/feast/issues/2297 |
| og:image:alt | Expected Behavior Using a Redis cluster as the online storage should work without errors. Current Behavior Using a Redis cluster as the online storage no longer works after updating from 0.17.0 to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstrimaitis |
| hostname | github.com |
| expected-hostname | github.com |
| None | db675ffbe86f3a08023aaf76f083fc7f65e074708cdc617650b84119176f1009 |
| 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 | 3e6c9f597d227b0490794716e8b9dddd21a41ead |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width