From 3fd8b61b27a1ae8c3322493417493eee52ace3be Mon Sep 17 00:00:00 2001 From: Edwin Jose Date: Mon, 29 Jun 2026 12:29:45 -0500 Subject: [PATCH 1/2] remove os data --- CONTRIBUTING.md | 2 ++ Makefile | 5 +++++ docs/docs/_partial-factory-reset-warning.mdx | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 889096700..83db6c74f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -262,6 +262,8 @@ make clear-os-data # Clear OpenSearch data directory completely make factory-reset # Complete reset: containers, volumes, and data ``` +The reset also removes any legacy `opensearch-data` directory, so old OpenSearch index files do not linger after cleanup. + --- ## Makefile Help System diff --git a/Makefile b/Makefile index b565f9d09..416b589ce 100644 --- a/Makefile +++ b/Makefile @@ -621,6 +621,11 @@ factory-reset: ## Complete reset (stop, remove volumes, clear data, remove image rm -rf data; \ echo "$(PURPLE)data removed$(NC)"; \ fi; \ + if [ -d "opensearch-data" ]; then \ + echo "Removing opensearch-data..."; \ + rm -rf opensearch-data; \ + echo "$(PURPLE)opensearch-data removed$(NC)"; \ + fi; \ if [ -n "$$OPENRAG_DATA_PATH" ] && [ -d "$$OPENRAG_DATA_PATH" ]; then \ echo "Removing $$OPENRAG_DATA_PATH..."; \ rm -rf "$$OPENRAG_DATA_PATH"; \ diff --git a/docs/docs/_partial-factory-reset-warning.mdx b/docs/docs/_partial-factory-reset-warning.mdx index c1e11894e..711a76bbf 100644 --- a/docs/docs/_partial-factory-reset-warning.mdx +++ b/docs/docs/_partial-factory-reset-warning.mdx @@ -4,6 +4,7 @@ This is a destructive operation that does the following: * Destroys all OpenRAG containers, volumes, and local images. * Prunes any additional container objects. * Deletes the contents of the `~/.openrag` directory _except_ for OpenRAG's `.env` file and the `/documents` subdirectory. +* Removes any legacy `opensearch-data` directory so old index data does not survive a reset.

Destroyed containers and deleted data are lost and cannot be recovered after running this operation. ::: @@ -19,4 +20,4 @@ Neither
nor wrapping the entire line in

worked consistently for b Either the line break was missing or the indentation was incorrect. This behavior was observed in Docusaurus 3.9.2 on 05 Dec 2025. In a future release, if this is not longer an issue, you can remove the tag and this note. :) ---> \ No newline at end of file +--> From 1a69b59a342dbe944dc31fd325d70891a1e41762 Mon Sep 17 00:00:00 2001 From: Edwin Jose Date: Tue, 30 Jun 2026 11:21:16 -0500 Subject: [PATCH 2/2] review comments --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 416b589ce..7ebd6d17b 100644 --- a/Makefile +++ b/Makefile @@ -591,6 +591,7 @@ factory-reset: ## Complete reset (stop, remove volumes, clear data, remove image echo " - Delete langflow-data directory"; \ echo " - Delete config directory"; \ echo " - Delete data directory (database and session configs)"; \ + echo " - Delete opensearch-data directory (legacy OpenSearch bind-mount data)"; \ echo " - Delete JWT keys (private_key.pem, public_key.pem)"; \ echo " - Remove OpenRAG images"; \ echo ""; \ @@ -623,8 +624,11 @@ factory-reset: ## Complete reset (stop, remove volumes, clear data, remove image fi; \ if [ -d "opensearch-data" ]; then \ echo "Removing opensearch-data..."; \ - rm -rf opensearch-data; \ - echo "$(PURPLE)opensearch-data removed$(NC)"; \ + if rm -rf opensearch-data; then \ + echo "$(PURPLE)opensearch-data removed$(NC)"; \ + else \ + echo "$(RED)Warning: Failed to remove opensearch-data (check permissions)$(NC)"; \ + fi; \ fi; \ if [ -n "$$OPENRAG_DATA_PATH" ] && [ -d "$$OPENRAG_DATA_PATH" ]; then \ echo "Removing $$OPENRAG_DATA_PATH..."; \