Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cleanup_index_files #1586

Merged
merged 1 commit into from Aug 30, 2018

Conversation

iilyak
Copy link
Contributor

@iilyak iilyak commented Aug 29, 2018

Overview

The previous implementation was based on a search using

{view_index_dir}/.shards/*/{db_name}.[0-9]*_design/mrview/*

This wildcard includes all shards for all indexes of all databases.
This caused performance issues in the case when there are thousands of databases on the node.
This PR changes the search to look at index_directory of a database.

Testing recommendations

make && make eunit apps=couch tests=mrview_cleanup_index_files_test_

Related Issues or Pull Requests

N/A

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

@jaydoane
Copy link
Contributor

test passes locally:

$ make eunit apps=couch tests=mrview_cleanup_index_files_test_
==> couch (eunit)
    Running test function(s):
      couchdb_mrview_tests:mrview_cleanup_index_files_test_/0
======================== EUnit ========================
Check index files cleanup
  clustered
    couchdb_mrview_tests:146: should_cleanup_index_files...[0.210 s] ok
    [done in 0.215 s]
=======================================================
  Test passed.

Copy link
Contributor

@jaydoane jaydoane left a comment

Choose a reason for hiding this comment

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

LGTM, after fixing indentation

make_test_case(clustered, [fun should_cleanup_index_files/2])
]
}
}.
Copy link
Contributor

Choose a reason for hiding this comment

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

The indentation here is inconsistent, and doesn't match the other tests in the file (which use 4 spaces per indent).

The previous implementation was based on a search using

    {view_index_dir}/.shards/*/{db_name}.[0-9]*_design/mrview/*

This wildcard includes all shards for all indexes of all databases.
This PR changes the search to look at index_directory of a database.
@iilyak iilyak force-pushed the improve-cleanup_index_files branch from ccf6380 to 0c6aa8b Compare August 30, 2018 10:39
@iilyak iilyak merged commit 50be214 into apache:master Aug 30, 2018
@iilyak iilyak deleted the improve-cleanup_index_files branch August 30, 2018 11:05
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.

None yet

2 participants