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
Merged

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

@jaydoane jaydoane commented Aug 29, 2018

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

LGTM, after fixing indentation

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

This comment has been minimized.

@jaydoane

jaydoane Aug 29, 2018
Contributor

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 cloudant:improve-cleanup_index_files branch from ccf6380 to 0c6aa8b Aug 30, 2018
@iilyak iilyak merged commit 50be214 into apache:master Aug 30, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@iilyak iilyak deleted the cloudant:improve-cleanup_index_files branch Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants