-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-11068. Move SstFiltered flag to a file in the snapshot directory #6965
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
Changes from 5 commits
25d178f
b0f7f6b
97649b0
71884e0
4723c2e
d091dbf
6423746
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |||||||||
| package org.apache.hadoop.ozone.om; | ||||||||||
|
|
||||||||||
| import com.google.common.annotations.VisibleForTesting; | ||||||||||
| import org.apache.hadoop.hdds.StringUtils; | ||||||||||
| import org.apache.hadoop.hdds.conf.OzoneConfiguration; | ||||||||||
| import org.apache.hadoop.hdds.utils.BackgroundService; | ||||||||||
| import org.apache.hadoop.hdds.utils.BackgroundTask; | ||||||||||
|
|
@@ -38,6 +39,9 @@ | |||||||||
| import org.slf4j.LoggerFactory; | ||||||||||
|
|
||||||||||
| import java.io.IOException; | ||||||||||
| import java.nio.file.Files; | ||||||||||
| import java.nio.file.Path; | ||||||||||
| import java.nio.file.Paths; | ||||||||||
| import java.util.Map; | ||||||||||
| import java.util.Optional; | ||||||||||
| import java.util.concurrent.TimeUnit; | ||||||||||
|
|
@@ -69,6 +73,10 @@ public class SstFilteringService extends BackgroundService | |||||||||
| // multiple times. | ||||||||||
| private static final int SST_FILTERING_CORE_POOL_SIZE = 1; | ||||||||||
|
|
||||||||||
| public static final String SST_FILTERED_FILE = "sstFiltered"; | ||||||||||
| private static final byte[] SST_FILTERED_FILE_CONTENT = StringUtils.string2Bytes("This directory holds information " + | ||||||||||
|
||||||||||
| private static final byte[] SST_FILTERED_FILE_CONTENT = StringUtils.string2Bytes("This directory holds information " + | |
| private static final byte[] SST_FILTERED_FILE_CONTENT = StringUtils.string2Bytes("This file holds information " + | |
| "if a particular snapshot has filtered out the irrelevant sst files or not.\nDO NOT add, change or delete " + | |
| "this file unless you know what you are doing.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "any files in this directory unless you know what you are doing.\n"); | |
| "this file unless you know what you are doing.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is inside the rocksdb directory. The statement is correct right isn't? Basically asking people not to change any file in this directory.
hemantk-12 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
hemantk-12 marked this conversation as resolved.
Show resolved
Hide resolved
hemantk-12 marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we log it at an info level, if SstFileringService fails because the snapshot is purged? Otherwise, it will be unnecessary noisy logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot be sure why the issue occured. RocksDbException can thrown for many reasons. One of them being the db being closed by another thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's why I asked to log it at the info level if it fails because snapshot dir doesn't exist which will be the case when it is purged. RocksDB throws exception like org.rocksdb.RocksDBException: While mkdir if missing: path_to_db_dir: No such file or directory..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we have
.txtor any other text file extension?