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

Feature/tiered caching #11

Draft
wants to merge 134 commits into
base: dummy-tiered-caching-base
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
fcd7476
Implemented and tested time took for QuerySearchResult objects for us…
Sep 28, 2023
87cbe2a
Moved setting to QueryPhase.execute()
Oct 2, 2023
cf18eb9
Moved setting to QueryPhase.execute()
Oct 2, 2023
c876de8
spotlessCheck
Oct 3, 2023
93a16d4
Added first draft of caching policy setup
Oct 4, 2023
8d6c8c4
Tiered caching framework draft changes
sgup432 Oct 9, 2023
83590e1
initial commit
Oct 10, 2023
aa0a5d7
fixed permissions
Oct 10, 2023
41dc035
Set up event listener to create RemovalNotification objects, also mis…
Oct 10, 2023
4ba49af
Added misc getter methods
Oct 11, 2023
dcb9fad
thread pool stuff
Oct 11, 2023
b912527
cleanup
Oct 11, 2023
44d5e61
Removed partial cache files from disk
Oct 11, 2023
43e2d1d
fixed double counting of on heap hit count
Oct 11, 2023
aa2d28d
first attempt at fixing cache closing issue in tests
Oct 11, 2023
354c311
misc stuff for testing
Oct 12, 2023
66915b6
Moved more stuff around for debugging issues
Oct 13, 2023
f985e63
fixed various serialization issues relating to silent ehcache put() a…
Oct 13, 2023
ae300e9
Cleanup
Oct 16, 2023
7a7b41f
More cleanup
Oct 16, 2023
ec729d0
Merged in Sagar's serialization changes
Oct 16, 2023
990ba9c
Part 1 of modifying ehcache to take serializable Key
Oct 16, 2023
d21af15
final attempts at doing it generally before learning that wasnt even …
Oct 17, 2023
d152478
Changed Ehcache disk tier implementation to not be generic, fixed per…
Oct 17, 2023
2d200fc
Fixed multiple disk tier instance issue, made spillover test pass
Oct 17, 2023
8f65db4
Removed persistence, cleaned up
Oct 17, 2023
7155afd
cleanup
Oct 17, 2023
c760594
added test entries metric for on heap
Oct 18, 2023
8510637
Fixed issue where multiple mock nodes on one JVM (in IT tests) would …
Oct 18, 2023
0b2e506
Merge branch 'framework-serialized' into update_node_stats
Oct 18, 2023
4680ea7
Added check for new entries field in IT test, added permissions allow…
Oct 18, 2023
c300d8b
Initial implementation for tiered node request cache stats
Oct 20, 2023
9d8d433
Added version checks to streaming functions
Oct 20, 2023
7d03562
Added UT for RequestCacheStats
Oct 23, 2023
c5099f1
Added IT for disk tier stats, plus spotlessApply
Oct 23, 2023
64b4bb3
cleaned up
Oct 23, 2023
8d13a17
Implements a memory-efficient roaring bitmap-based keystore for use i…
Sep 22, 2023
08a4f6d
Adds and tests took time for QuerySearchResult
Oct 9, 2023
dfd9128
Addressed Ankit's comments
Oct 19, 2023
a9ab327
Removed minimum version variable
Oct 20, 2023
4e57f4c
Changed type for tookTime from long to Long, to address Sagar's comment
Oct 26, 2023
1d47f38
Addressed dblock's comment
Oct 31, 2023
e39514b
Adds Serializer interface for use in ehcache disk tier and elsewhere;…
Nov 1, 2023
d45e6cf
Addressed Sagar's comments besides new counter/arraylist setup for re…
Nov 2, 2023
157ca6e
Addressed comments besides moving IT tests into IndicesRequestCacheIT…
Nov 6, 2023
4045616
Implemented/tested counter+removal list setup to allow more removals
Nov 6, 2023
0825316
Merge branch 'keystore-squashed' into feature/tiered-caching
Nov 6, 2023
8e51749
Integrated keystore
Nov 6, 2023
5099968
removed exceptions from interface signatures
Nov 6, 2023
207ca99
Merge branch 'tooktime-squashed' into feature/tiered-caching
Nov 6, 2023
21dab6f
Adds caching policy
Oct 4, 2023
e5cadb0
Merge branch 'caching-policy-squashed' into feature/tiered-caching
Nov 6, 2023
f149eec
Added first-draft integration for caching policy which will be change…
Nov 7, 2023
ee7301a
Added unit test for ehcache tier's took time policy integration
Nov 7, 2023
ee11ed8
Reworked caching policy to sit at tiered cache service level and use …
Nov 8, 2023
5123142
Fixed issue with eviction test for IRC tests
Nov 8, 2023
4865827
first parts of cachevalue rework (nonfunctional)
Nov 8, 2023
695521f
Merge commit '157ca6e9557cc5864c45c930be97efa6f17ea269' into cache-value
Nov 8, 2023
8fb86b7
Almost finished statsholder impl side, found and deleted a lot of old…
Nov 9, 2023
900230d
Finished cachevalue rework + disk stats implementation
Nov 10, 2023
07a2e4b
Simplified RBM size estimator
Nov 11, 2023
a9df136
Merge branch 'keystore-squashed' into feature/tiered-caching
Nov 11, 2023
2f884c2
addressed sagar's comments
Nov 13, 2023
9d88676
merged in serializer changes
Nov 13, 2023
4e8ba0b
Fixed broken test
Nov 13, 2023
41ae53e
Merged in cache value changes
Nov 13, 2023
09748eb
Re-added and tested serializer for IRC key
Nov 13, 2023
8cb83d7
added null check to BR deserializer
Nov 14, 2023
111c4e6
Fixed ehcache init issue in test cases
Nov 14, 2023
55b09fe
cleanup, fixed commented line
Nov 14, 2023
24a3cb9
Fixed issues with closing disk tier in tests, added IT for disk speci…
Nov 14, 2023
6a280c6
removed print statement
Nov 14, 2023
175c5c5
Removed incorrect line from test
Nov 16, 2023
af5178f
added required javadoc
Nov 17, 2023
7d1ce12
Optimized modulo calculation with bitmask
Nov 22, 2023
57e948f
Addressed Sagar's comments on caching policy/generics
Nov 22, 2023
c51e0f3
Addressed Sagar's other comments
Nov 22, 2023
100ca7b
removed dead code
Nov 22, 2023
c415ec8
removed more dead code
Nov 22, 2023
93fa4f8
Changed memory size estimator to reflect optimized modulo
Nov 27, 2023
433470e
Optimizes modulo using bitmask
Nov 27, 2023
52b9dfd
Update IndicesRequestCache.java
kiranprakash154 Nov 14, 2023
5bab65d
More updates to disk cache cleanup
kiranprakash154 Nov 17, 2023
4500090
register INDICES_REQUEST_CACHE_DISK_CLEAN_THRESHOLD_SETTING in cluste…
kiranprakash154 Nov 29, 2023
4199bc2
make INDICES_REQUEST_CACHE_DISK_CLEAN_INTERVAL_SETTING dynamic property
kiranprakash154 Nov 29, 2023
6e05b9d
minor changes
kiranprakash154 Nov 29, 2023
aa3c39c
change the way we calculate disk key staleness
kiranprakash154 Nov 29, 2023
83d70f7
fix breaking tests
kiranprakash154 Nov 29, 2023
e41321d
dummy commit
Nov 30, 2023
a51da38
Changed github action to run on my fork. REVERT THISgit add .
Nov 30, 2023
f0a26b9
added broken javadoc
Nov 30, 2023
caae291
Fix test to include IndexShard
kiranprakash154 Nov 30, 2023
9d0eab1
UT for testing invalidate of DiskTier is called
kiranprakash154 Nov 30, 2023
01bcad7
added upload artifact section to workflow, spotlessApply
Nov 30, 2023
c6a93a4
Added notification for REMOVED case in ehcache event listener
Dec 1, 2023
93ef124
draft changes for enable disk tier setting
Dec 4, 2023
20114ca
reverted modified github actions
Dec 4, 2023
b7fcac7
reverted modified github actions
Dec 4, 2023
5c472ae
Introduce CleanupStatus to keysToClean
kiranprakash154 Dec 5, 2023
be10a16
use that cleanupStatus and logic to update staleKeyEntries
kiranprakash154 Dec 5, 2023
4c8b240
register INDICES_REQUEST_CACHE_DISK_CLEAN_INTERVAL_SETTING to cluster…
kiranprakash154 Dec 5, 2023
eeb973e
Add removal listener to update eh cache stats
kiranprakash154 Dec 5, 2023
f22cdaf
re-organize imports
kiranprakash154 Dec 5, 2023
280cb07
Add IT tests
kiranprakash154 Dec 5, 2023
27f122b
Merge branch 'feature/tiered-caching' into kp/delete-stale-keys
kiranprakash154 Dec 5, 2023
295ff1a
Added RBM size setting + UT
Dec 5, 2023
163d7fe
added UT for setting switch
Dec 5, 2023
29d31b4
added skeleton for stale key threshold setting
Dec 5, 2023
856160e
Added commented-out lines to opensearch.yml
Dec 5, 2023
4bdf459
added feature flag
Dec 6, 2023
347a14c
added ehcache cluster settings
Dec 7, 2023
64c339a
added feature flag setting to disk tier IT
Dec 7, 2023
90c0f9a
added null checks to key and dummy string serializers
Dec 7, 2023
47453e1
Integrated misc changes from other branch
Dec 8, 2023
216d99d
changed dummy disk cache size from 1 MB -> 10 GB
Dec 11, 2023
6483c69
Merge branch 'misc-settings' into enable-disk-setting
Dec 11, 2023
8db79e0
added first draft of dynamic disk tier enable/disable logic
Dec 12, 2023
153c575
added IT testing toggling disk tier dynamic setting
Dec 12, 2023
52dad7a
cleanup
Dec 12, 2023
1671e2f
removed disk tier checks from IT where disk tier is not turned on
Dec 12, 2023
24b5f14
added checks to disk enable/disable fns, condensed IT
Dec 12, 2023
1c1a2b5
set default disk tier size to 100 mb
Dec 12, 2023
2758ee3
invalidateAll() also invalidates keys from inactive disk tier
Dec 13, 2023
f8b0425
set disk threshold policy to 0
Dec 13, 2023
8f0b5bc
refactor cleanCache & cleanDiskCache to share methods
kiranprakash154 Dec 15, 2023
8c996b3
null checks for indexShard
kiranprakash154 Dec 15, 2023
4bd1503
some bugs i found
kiranprakash154 Dec 15, 2023
1911fa6
use assertNumCacheEntries
kiranprakash154 Dec 15, 2023
ae0b471
update print statement
kiranprakash154 Dec 15, 2023
fce110d
edit sleep time
kiranprakash154 Dec 15, 2023
7d2ea2e
changed setting paths from index to indices for non-index level settings
Dec 15, 2023
49c9bbd
Addressed Kiran's comments
Dec 18, 2023
dc3fd1e
Merge branch 'misc-settings' into feature/tiered-caching
Dec 18, 2023
f375874
Merge branch 'kp/delete-stale-keys' into feature/tiered-caching
Dec 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ testfixtures_shared/
.ci/jobs/

# build files generated
doc-tools/missing-doclet/bin/
doc-tools/missing-doclet/bin/
server/src/main/java/org/opensearch/indices/KLSPerformanceTest.java
6 changes: 5 additions & 1 deletion .idea/runConfigurations/Debug_OpenSearch.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions distribution/src/config/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@ ${path.logs}
# Once there is no observed impact on performance, this feature flag can be removed.
#
#opensearch.experimental.optimization.datetime_formatter_caching.enabled: false
#
#
# Gates the tiered caching feature. This feature adds a disk tier to the IndicesRequestCache.
# opensearch.experimental.feature.tiered_caching.enabled: false
3 changes: 3 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ dependencies {
api "org.ehcache:ehcache:${versions.ehcache}"
api "org.slf4j:slf4j-api:${versions.slf4j}"

// roaring bitmaps
api 'org.roaringbitmap:RoaringBitmap:0.9.49'
runtimeOnly 'org.roaringbitmap:shims:0.9.49'

testImplementation(project(":test:framework")) {
// tests use the locally compiled version of server
Expand Down
1 change: 1 addition & 0 deletions server/licenses/RoaringBitmap-0.9.49.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b45b49c1ec5c5fc48580412d0ca635e1833110ea
191 changes: 191 additions & 0 deletions server/licenses/RoaringBitmap-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.

"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.

"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.

2. Grant of Copyright License.

Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.

3. Grant of Patent License.

Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.

4. Redistribution.

You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:

You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.

5. Submission of Contributions.

Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.

6. Trademarks.

This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.

7. Disclaimer of Warranty.

Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.

8. Limitation of Liability.

In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability.

While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work

To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "[]" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.

Copyright 2013-2016 the RoaringBitmap authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Empty file.
1 change: 1 addition & 0 deletions server/licenses/shims-0.9.49.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8bd7794fbdaa9536354dd2d8d961d9503beb9460
Loading