Skip to content

Conversation

naveenpaul1
Copy link
Contributor

@naveenpaul1 naveenpaul1 commented Jul 17, 2025

Describe the Problem

Explain the Changes

  1. remove mongo_pool and use BLOCK_STORE_FS based default backingstoire
  2. Remove mongo related tools
  3. Delete block_store_mongo.js

Issues: Fixed #xxx / Gap #xxx

  1. MongoDB is not used in the latest version of NooBaa, and any unnecessary MongoDB-related code should be removed from the NooBaa core

Testing Instructions:

  1. Create bucket and put and get object from it
  2. All the fuctionalities should work as before
  • Doc added/updated
  • Tests added

Summary by CodeRabbit

  • New Features

    • The default pool type for new setups is now filesystem-backed ("HOSTS"), with internal MongoDB-backed pools no longer supported.
  • Bug Fixes

    • Error messages and logs now consistently reference only cloud pools, removing outdated references to Mongo pools.
  • Refactor

    • All logic, APIs, and schemas related to internal MongoDB-backed pools have been removed, simplifying pool management and related operations.
    • APIs and account/bucket management now exclusively use cloud or hosts pools, with updated validation and resource selection rules.
    • Pool selection, node monitoring, and mirror weight calculations no longer consider Mongo pools.
    • Statistics aggregation now includes all pools without excluding former Mongo pools.
  • Documentation

    • Comments updated to reflect the new default pool type and removal of Mongo pool references.

Copy link

coderabbitai bot commented Jul 17, 2025

Walkthrough

This change set removes all support and logic related to "mongo pools" (internal MongoDB-backed storage pools) across the codebase. It eliminates configuration, schema definitions, API endpoints, error handling, and all code branches involving mongo pools. The system now exclusively supports "cloud pools" (filesystem/hosts-backed pools), simplifying pool management, agent handling, account and bucket operations, and related services.

Changes

File(s) Change Summary
config.js Removed NODES_PER_MONGO_POOL; changed DEFAULT_POOL_TYPE default to 'HOSTS'.
src/agent/agent.js Updated error handling to remove references to mongo pools in _do_heartbeat.
src/api/hosted_agents_api.js Corrected indentation of mongo_info property in create_agent params schema.
src/api/object_api.js, src/sdk/map_api_types.js, src/server/object_services/map_db_types.js Removed in_mongo_pool property from block_info/adminfo and related assignments.
src/api/pool_api.js Removed create_mongo_pool API method.
src/hosted_agents/hosted_agents.js Removed all logic and branches related to mongo_pool_info and internal pools; now only uses cloud_pool_info.
src/server/node_services/node_allocator.js Deleted node count validation for mongo pools in _get_tier_pools_status.
src/server/node_services/nodes_monitor.js Removed mongo pool selection/marking logic; updated log messages to refer only to cloud pools.
src/server/object_services/mapper.js Removed mongo pool weight logic and redundancy checks; now only considers cloud pools.
src/server/system_services/account_server.js Removed dependency on mongo pools; now identifies internal pool by name 'backingstores'.
src/server/system_services/bucket_server.js Removed all logic and constraints related to internal mongo pools; simplified pool validation.
src/server/system_services/pool_server.js Removed all mongo pool creation, helpers, and references; simplified pool info and deletion logic.
src/server/system_services/schemas/pool_schema.js Deleted mongo_pool_info schema definition.
src/server/system_services/stats_aggregator.js Removed skips for pools with mongo_pool_info in stats aggregation functions.
src/server/system_services/system_server.js Removed support for 'INTERNAL' pool type; now only creates 'HOSTS' pools; adjusted pool filtering logic.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API
    participant PoolServer
    participant Agent
    participant Storage

    Client->>API: Create pool / agent / bucket
    API->>PoolServer: Create pool (only HOSTS/cloud)
    PoolServer->>Storage: Setup cloud_pool_info
    API->>Agent: Create agent (cloud_pool_info only)
    Agent->>Storage: Store agent info (cloud path)
    API->>API: All internal mongo pool logic is removed
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

size/XL, Enable-Auto-Rebase

Suggested reviewers

  • jackyalbo
  • liranmauda
  • tangledbytes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b93d14 and 775b8b6.

📒 Files selected for processing (17)
  • config.js (1 hunks)
  • src/agent/agent.js (1 hunks)
  • src/api/hosted_agents_api.js (1 hunks)
  • src/api/object_api.js (0 hunks)
  • src/api/pool_api.js (0 hunks)
  • src/hosted_agents/hosted_agents.js (4 hunks)
  • src/sdk/map_api_types.js (0 hunks)
  • src/server/node_services/node_allocator.js (0 hunks)
  • src/server/node_services/nodes_monitor.js (2 hunks)
  • src/server/object_services/map_db_types.js (0 hunks)
  • src/server/object_services/mapper.js (2 hunks)
  • src/server/system_services/account_server.js (3 hunks)
  • src/server/system_services/bucket_server.js (4 hunks)
  • src/server/system_services/pool_server.js (2 hunks)
  • src/server/system_services/schemas/pool_schema.js (0 hunks)
  • src/server/system_services/stats_aggregator.js (0 hunks)
  • src/server/system_services/system_server.js (2 hunks)
💤 Files with no reviewable changes (7)
  • src/server/object_services/map_db_types.js
  • src/api/pool_api.js
  • src/server/system_services/stats_aggregator.js
  • src/sdk/map_api_types.js
  • src/server/system_services/schemas/pool_schema.js
  • src/api/object_api.js
  • src/server/node_services/node_allocator.js
✅ Files skipped from review due to trivial changes (3)
  • config.js
  • src/api/hosted_agents_api.js
  • src/agent/agent.js
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/server/system_services/pool_server.js
  • src/server/system_services/system_server.js
  • src/server/node_services/nodes_monitor.js
  • src/server/object_services/mapper.js
  • src/hosted_agents/hosted_agents.js
  • src/server/system_services/account_server.js
  • src/server/system_services/bucket_server.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Noobaa Image
  • GitHub Check: run-jest-unit-tests
  • GitHub Check: run-package-lock-validation
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@naveenpaul1 naveenpaul1 force-pushed the remove-mongo-code branch 5 times, most recently from 697ec90 to 29fcf33 Compare July 22, 2025 06:35
@naveenpaul1 naveenpaul1 marked this pull request as ready for review July 22, 2025 07:34
@naveenpaul1 naveenpaul1 requested review from dannyzaken, shirady, liranmauda, jackyalbo and tangledbytes and removed request for shirady July 22, 2025 07:34
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (6)
src/server/node_services/nodes_monitor.js (2)

858-858: Remove remaining MongoDB node reference.

This line still checks for item.node.is_mongo_node, which should have been removed as part of the MongoDB elimination. Since MongoDB support is being completely removed, this condition should be updated.

-                if (!item.node_from_store && (item.node.is_mongo_node || item.node.is_cloud_node)) {
+                if (!item.node_from_store && item.node.is_cloud_node) {

1336-1340: Remove MongoDB N2N configuration block.

This entire code block configures N2N settings for MongoDB nodes, which should be completely removed since MongoDB support has been eliminated from the codebase.

-            if (item.node.is_mongo_node) {
-                n2n_config.tcp_permanent_passive = {
-                    port: config.MONGO_AGENTS_N2N_PORT
-                };
-            }
src/agent/agent.js (3)

463-469: Fix typo in error messages: "cloud pool pool"

The error messages on lines 465 and 475 contain a typo - "cloud pool pool" should be "cloud pool".

-            dbg.error(`shouldn't be here. found duplicated node for cloud pool or mongo pool!!`);
+            dbg.error(`shouldn't be here. found duplicated node for cloud pool!!`);
-            dbg.error(`shouldn't be here. node not found for cloud pool pool!!`);
+            dbg.error(`shouldn't be here. node not found for cloud pool!!`);

Also applies to: 474-477


794-796: Remove remaining MongoDB references.

These lines still reference mongo_info which should be removed as part of the MongoDB cleanup.

-        if (this.mongo_info && this.mongo_info.pool_name) {
-            reply.pool_name = this.mongo_info.pool_name;
-        }

1-1092: Remove remaining MongoDB references across the codebase

Our search found numerous MongoDB‐related entries that must be cleaned up to complete the removal:

• config.js
– MONGO_DEFAULTS, MONGO_AGENTS_N2N_PORT, CFG_DB_PATH, etc.
• src/util/
– mongo_client.js, mongo_utils.js
– postgres_client.js (mongo_query-to-postgres usage)
• src/server/system_services/
– system_server.js, stats_aggregator.js, pool_server.js, replication_store.js, cluster_server.js
• src/server/node_services/
– nodes_store.js, nodes_client.js, nodes_aggregator.js, nodes_monitor.js
• src/server/notifications/alerts_log_store.js
• src/object_services/ & bg_services/
– md_store.js, map_builder.js, mirror_writer.js, md_aggregator.js
• src/api/
– system_api.js, pool_api.js, node_api.js, common_api.js
• hosted_agents/hosted_agents.js
• sdk/bucketspace_fs.js
• cmd/manage_nsfs.js, tools/**/*.js

Please remove or refactor all of these references so that MongoDB is fully eliminated from the codebase.

src/server/system_services/account_server.js (1)

379-383: Filter predicate is missing.

The _.filter call on line 379 doesn't have a predicate function, which means it will return all pools. This appears to be incomplete - you likely need to filter out specific pools (perhaps the 'backingstores' pool?).

-            const pools = _.filter(req.system.pools_by_name);
+            const pools = _.filter(req.system.pools_by_name, pool => pool.name !== 'backingstores');
🧹 Nitpick comments (3)
src/server/system_services/account_server.js (1)

88-93: LGTM! Consider using optional chaining for cleaner code.

The change correctly replaces the mongo pool with 'backingstores' as the default resource. However, the code could be simplified using optional chaining as suggested by static analysis.

-            const resource = req.rpc_params.default_resource ?
-            req.system.pools_by_name[req.rpc_params.default_resource] ||
-                (req.system.namespace_resources_by_name && req.system.namespace_resources_by_name[req.rpc_params.default_resource]) :
-                req.system.pools_by_name.backingstores;
+            const resource = req.rpc_params.default_resource ?
+                req.system.pools_by_name[req.rpc_params.default_resource] ||
+                req.system.namespace_resources_by_name?.[req.rpc_params.default_resource] :
+                req.system.pools_by_name.backingstores;
src/server/system_services/bucket_server.js (2)

330-334: LGTM! Consider using optional chaining.

The function correctly removes mongo pool validation. Consider using optional chaining as suggested by static analysis for cleaner code.

-        if (!(default_pool && default_pool._id)) throw new RpcError('SERVICE_UNAVAILABLE', 'Non existing pool');
+        if (!default_pool?._id) throw new RpcError('SERVICE_UNAVAILABLE', 'Non existing pool');

1660-1660: Consider removing the unused metric entirely.

Since internal storage is no longer supported, hardcoding is_using_internal: false is correct but not ideal. Consider removing this metric entirely from the return object if it's no longer relevant.

     return {
-        is_using_internal: false,
         has_any_pool_configured,
         has_enough_healthy_nodes_for_tiering,
         // ... rest of the metrics

Also update any code that references this metric, such as the return_bucket_issues_mode function on line 1732.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24e11b7 and 29fcf33.

📒 Files selected for processing (32)
  • config.js (1 hunks)
  • src/agent/agent.js (2 hunks)
  • src/agent/block_store_services/block_store_mongo.js (0 hunks)
  • src/api/api.js (0 hunks)
  • src/api/hosted_agents_api.js (0 hunks)
  • src/api/object_api.js (0 hunks)
  • src/api/pool_api.js (0 hunks)
  • src/api/server_inter_process_api.js (0 hunks)
  • src/deploy/NVA_build/common_funcs.sh (0 hunks)
  • src/deploy/NVA_build/set_mongo_repo.sh (0 hunks)
  • src/hosted_agents/hosted_agents.js (4 hunks)
  • src/sdk/map_api_types.js (0 hunks)
  • src/server/common_services/server_inter_process.js (0 hunks)
  • src/server/mongo_services/mongo_monitor.js (0 hunks)
  • src/server/node_services/node_allocator.js (0 hunks)
  • src/server/node_services/nodes_monitor.js (2 hunks)
  • src/server/object_services/map_db_types.js (0 hunks)
  • src/server/object_services/mapper.js (2 hunks)
  • src/server/server_rpc.js (0 hunks)
  • src/server/system_services/account_server.js (3 hunks)
  • src/server/system_services/bucket_server.js (4 hunks)
  • src/server/system_services/pool_server.js (2 hunks)
  • src/server/system_services/schemas/pool_schema.js (0 hunks)
  • src/server/system_services/stats_aggregator.js (0 hunks)
  • src/server/system_services/system_server.js (2 hunks)
  • src/test/framework/report.js (0 hunks)
  • src/tools/gridfs_stress.js (0 hunks)
  • src/tools/mongo_md_stats.js (0 hunks)
  • src/tools/mongo_profiler.js (0 hunks)
  • src/tools/mongodb_blow.js (0 hunks)
  • src/tools/mongodb_bucket_blow.js (0 hunks)
  • src/util/mongo_utils.js (0 hunks)
🧠 Learnings (3)
src/hosted_agents/hosted_agents.js (1)

Learnt from: naveenpaul1
PR: #9042
File: src/util/cloud_utils.js:183-194
Timestamp: 2025-06-17T12:59:51.543Z
Learning: In the set_noobaa_s3_connection function in src/util/cloud_utils.js, internal NooBaa S3 endpoints (filtered by 'api': 's3', 'kind': 'INTERNAL') will always be non-secure, so tls: false is the correct setting despite the conditional https:// scheme logic.

src/server/system_services/account_server.js (1)

Learnt from: naveenpaul1
PR: #9042
File: src/util/cloud_utils.js:183-194
Timestamp: 2025-06-17T12:59:51.543Z
Learning: In the set_noobaa_s3_connection function in src/util/cloud_utils.js, internal NooBaa S3 endpoints (filtered by 'api': 's3', 'kind': 'INTERNAL') will always be non-secure, so tls: false is the correct setting despite the conditional https:// scheme logic.

src/server/system_services/bucket_server.js (1)

Learnt from: naveenpaul1
PR: #9042
File: src/util/cloud_utils.js:183-194
Timestamp: 2025-06-17T12:59:51.543Z
Learning: In the set_noobaa_s3_connection function in src/util/cloud_utils.js, internal NooBaa S3 endpoints (filtered by 'api': 's3', 'kind': 'INTERNAL') will always be non-secure, so tls: false is the correct setting despite the conditional https:// scheme logic.

🧬 Code Graph Analysis (1)
config.js (16)
src/server/node_services/nodes_monitor.js (1)
  • config (15-15)
src/util/http_utils.js (1)
  • config (19-19)
src/endpoint/endpoint.js (1)
  • config (18-18)
src/manage_nsfs/nc_lifecycle.js (1)
  • config (10-10)
src/util/notifications_util.js (1)
  • config (5-5)
src/util/fork_utils.js (1)
  • config (11-11)
src/cmd/manage_nsfs.js (1)
  • config (18-18)
src/sdk/bucketspace_fs.js (1)
  • config (9-9)
src/sdk/namespace_fs.js (1)
  • config (13-13)
src/endpoint/s3/s3_rest.js (1)
  • config (15-15)
src/util/native_fs_utils.js (1)
  • config (10-10)
src/manage_nsfs/manage_nsfs_glacier.js (1)
  • config (6-6)
src/cmd/nsfs.js (1)
  • config (20-20)
src/agent/block_store_services/block_store_base.js (1)
  • config (9-9)
src/util/debug_module.js (1)
  • config (24-24)
src/server/bg_workers.js (1)
  • config (16-16)
🪛 Biome (1.9.4)
src/server/system_services/account_server.js

[error] 91-91: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/server/system_services/bucket_server.js

[error] 332-332: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

💤 Files with no reviewable changes (23)
  • src/server/object_services/map_db_types.js
  • src/api/pool_api.js
  • src/sdk/map_api_types.js
  • src/deploy/NVA_build/set_mongo_repo.sh
  • src/server/common_services/server_inter_process.js
  • src/api/hosted_agents_api.js
  • src/server/server_rpc.js
  • src/api/server_inter_process_api.js
  • src/api/api.js
  • src/server/system_services/schemas/pool_schema.js
  • src/server/node_services/node_allocator.js
  • src/test/framework/report.js
  • src/server/system_services/stats_aggregator.js
  • src/api/object_api.js
  • src/tools/mongodb_bucket_blow.js
  • src/server/mongo_services/mongo_monitor.js
  • src/tools/mongo_profiler.js
  • src/tools/mongo_md_stats.js
  • src/agent/block_store_services/block_store_mongo.js
  • src/deploy/NVA_build/common_funcs.sh
  • src/util/mongo_utils.js
  • src/tools/gridfs_stress.js
  • src/tools/mongodb_blow.js
🧰 Additional context used
🧠 Learnings (3)
src/hosted_agents/hosted_agents.js (1)

Learnt from: naveenpaul1
PR: #9042
File: src/util/cloud_utils.js:183-194
Timestamp: 2025-06-17T12:59:51.543Z
Learning: In the set_noobaa_s3_connection function in src/util/cloud_utils.js, internal NooBaa S3 endpoints (filtered by 'api': 's3', 'kind': 'INTERNAL') will always be non-secure, so tls: false is the correct setting despite the conditional https:// scheme logic.

src/server/system_services/account_server.js (1)

Learnt from: naveenpaul1
PR: #9042
File: src/util/cloud_utils.js:183-194
Timestamp: 2025-06-17T12:59:51.543Z
Learning: In the set_noobaa_s3_connection function in src/util/cloud_utils.js, internal NooBaa S3 endpoints (filtered by 'api': 's3', 'kind': 'INTERNAL') will always be non-secure, so tls: false is the correct setting despite the conditional https:// scheme logic.

src/server/system_services/bucket_server.js (1)

Learnt from: naveenpaul1
PR: #9042
File: src/util/cloud_utils.js:183-194
Timestamp: 2025-06-17T12:59:51.543Z
Learning: In the set_noobaa_s3_connection function in src/util/cloud_utils.js, internal NooBaa S3 endpoints (filtered by 'api': 's3', 'kind': 'INTERNAL') will always be non-secure, so tls: false is the correct setting despite the conditional https:// scheme logic.

🧬 Code Graph Analysis (1)
config.js (16)
src/server/node_services/nodes_monitor.js (1)
  • config (15-15)
src/util/http_utils.js (1)
  • config (19-19)
src/endpoint/endpoint.js (1)
  • config (18-18)
src/manage_nsfs/nc_lifecycle.js (1)
  • config (10-10)
src/util/notifications_util.js (1)
  • config (5-5)
src/util/fork_utils.js (1)
  • config (11-11)
src/cmd/manage_nsfs.js (1)
  • config (18-18)
src/sdk/bucketspace_fs.js (1)
  • config (9-9)
src/sdk/namespace_fs.js (1)
  • config (13-13)
src/endpoint/s3/s3_rest.js (1)
  • config (15-15)
src/util/native_fs_utils.js (1)
  • config (10-10)
src/manage_nsfs/manage_nsfs_glacier.js (1)
  • config (6-6)
src/cmd/nsfs.js (1)
  • config (20-20)
src/agent/block_store_services/block_store_base.js (1)
  • config (9-9)
src/util/debug_module.js (1)
  • config (24-24)
src/server/bg_workers.js (1)
  • config (16-16)
🪛 Biome (1.9.4)
src/server/system_services/account_server.js

[error] 91-91: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/server/system_services/bucket_server.js

[error] 332-332: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (14)
src/server/node_services/nodes_monitor.js (2)

615-615: LGTM - MongoDB pool exclusion correctly removed from fallback logic.

The change properly removes mongo_pool_info filtering from the fallback pool selection, ensuring only cloud pools are excluded when determining the default pool for new nodes.


1725-1725: LGTM - Log message correctly updated to reflect MongoDB removal.

The log message appropriately removes references to MongoDB nodes, maintaining only cloud node error logging which aligns with the codebase changes.

src/hosted_agents/hosted_agents.js (5)

65-65: LGTM: Correct filtering for cloud pools only.

The filter change correctly removes support for pools with only mongo_pool_info and now only processes pools that have cloud_pool_info defined, which aligns with the MongoDB removal objectives.


117-117: LGTM: Hardcoded path simplification.

The hardcoded path to 'cloud_pool_info.agent_info.cloud_path' correctly removes the conditional logic that previously selected between mongo and cloud pool paths, focusing exclusively on cloud pools.


133-133: LGTM: Consistent cloud pool info usage.

The change to always use pool.cloud_pool_info removes the conditional branching between mongo and cloud pools, maintaining consistency with the MongoDB removal effort.


136-136: LGTM: Simplified pool agent path.

Hardcoding pool_agent_path to 'cloud_pool_info' removes the conditional logic and ensures all agent paths use cloud pool information exclusively.


377-377: LGTM: Consistent token path handling.

The hardcoded pool_property_path to 'cloud_pool_info.agent_info' ensures token operations always use cloud pool paths, completing the removal of mongo pool support from the helper function.

src/server/system_services/system_server.js (2)

191-198: LGTM: Correct removal of INTERNAL pool type support.

The change removes the INTERNAL pool type branch that created MongoDB-backed pools and now only supports HOSTS pool type with filesystem backing. This correctly implements the PR objective to remove MongoDB dependencies and use BLOCK_STORE_FS as the default.

The error handling for unsupported pool types is appropriate.


605-605: LGTM: Simplified pool filtering logic.

The removal of the mongo_pool_info.pending_delete check from the pool filtering logic correctly eliminates MongoDB-specific handling while maintaining the cloud pool filtering. This change is consistent with the broader MongoDB removal effort.

src/server/system_services/pool_server.js (2)

750-750: LGTM! Correctly simplified to use cloud pool info only.

The change from dynamically selecting the pending delete property to always using cloud_pool_info.pending_delete is appropriate since MongoDB pools are being removed.


1324-1334: No Mongo-specific Filter Found – Ignore This Concern

I searched the codebase for any references to “mongo” in the default_resource logic (e.g. is_mongo_pool, mongo_pool_info) and found none. It looks like the filter has always been merely account.default_resource—there was never a Mongo-only check to remove.

If you do need to limit this update to Mongo pools specifically, you’ll have to add that condition explicitly. Otherwise, no changes are required here.

Likely an incorrect or invalid review comment.

src/server/object_services/mapper.js (2)

62-68: Weight assignment logic reordered correctly.

The reordering of weight assignments maintains the same priority (local=3, regular=2, redundant=1) while removing the special handling for mongo pools. The logic is cleaner and correct.


371-371: Simplified redundancy check is appropriate.

The function now only considers cloud pools as having redundancy, which aligns with removing MongoDB pool support.

src/server/system_services/account_server.js (1)

1386-1388: LGTM!

The change correctly updates the non-internal resources check to exclude the 'backingstores' pool instead of relying on mongo_pool_info.

@naveenpaul1 naveenpaul1 requested a review from romayalon July 23, 2025 04:50
@jackyalbo
Copy link
Contributor

@naveenpaul1 Any chance we can split this PR into 2 (maybe 2 commits is enough)?
one, just for removing the mongo pool and second, all the others?
Let me know what you think.

@naveenpaul1
Copy link
Contributor Author

@jackyalbo Sure, I will push changes that are not related to mongo_pool to the next PR.

@naveenpaul1 naveenpaul1 changed the title Mongo | Remove mongo code and mongo_pool (1/2) Mongo | Remove mongo_pool code(1/2) Jul 23, 2025
@naveenpaul1 naveenpaul1 merged commit 9ab748b into noobaa:master Jul 28, 2025
40 of 42 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Aug 11, 2025
2 tasks
@coderabbitai coderabbitai bot mentioned this pull request Aug 21, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants