Skip to content

feat: store collection relation cache in Redis when enabled- #1305 - #1307

Merged
pallakartheekreddy merged 3 commits into
Sunbird-Knowlg:v1.0.3from
romitshah02:redis-cache
Aug 17, 2026
Merged

feat: store collection relation cache in Redis when enabled- #1305#1307
pallakartheekreddy merged 3 commits into
Sunbird-Knowlg:v1.0.3from
romitshah02:redis-cache

Conversation

@romitshah02

Copy link
Copy Markdown
Contributor

Adds a Redis-backed path for the collection hierarchy relationship-rebuild API, part of a larger cross-repo change (knowlg-publish job now writes hierarchy data to Redis on publish; lern-service /content/state/update now reads from Redis) — this repo's piece covers the "rebuild if missing" API.

POST /collection/v4/hierarchy/update/relation/:identifier → RelationManager.updateHierarchyRelationships computes leaf-node, optional-node, and ancestor-node maps from a collection's hierarchy and persists them. Previously always wrote to the Yugabyte-backed hierarchy_relations Cassandra table via ExternalStore. Now, when redis.enable=true, it writes each map as a simple key → node-id-list entry in Redis via the existing RedisCache.saveList, keyed as $rootId:$identifier:$relationshipType (same key shape as before). Falls back to the existing Yugabyte path when Redis is disabled — no schema/config changes required, no new dependency (module already pulls in platform-cache transitively via graph-engine, same as HierarchyManager.scala in this module).

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8534e622-8975-4cc8-9ca5-f99a2c0a2a25

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pallakartheekreddy
pallakartheekreddy merged commit 3b4c777 into Sunbird-Knowlg:v1.0.3 Aug 17, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants