Commit Graph

182 Commits

Author SHA1 Message Date
neethuhaneesha bced2e124c Added metrics for read range operations. 2023-01-22 19:22:07 -08:00
neethuhaneesha ca4a964df1
Adding rocksDB control compaction on deletion knobs. (#9144) 2023-01-18 15:40:34 -08:00
neethuhaneesha c9fd51d2ec
Adding rocksdb read latency metrics. (#9036) 2022-12-22 13:00:43 -08:00
Jingyu Zhou 4269820ed0 Fix log file name too long for RocksDB in simulation
If a log directory is specified in the "db_log_dir" option, RocksDB will add the whole file path in the log file name, which can exceed the 255 byte limit of Linux file system, causing storage server failures.

See
c3f720c60d/include/rocksdb/options.h (L674-L679)
2022-12-19 09:52:21 -08:00
He Liu 2024237e5d
Fetch checkpoint as key-value pairs (#9003)
* Allow multiple keyranges in CheckpointRequest.
Include DataMove ID in CheckpointMetaData.

* Use UID dataMoveId instead of Optional<UID>.

* Implemented ShardedRocks::checkpoint().

* Implementing createCheckpoint().

* Attempted to change getCheckpointMetaData*() for a single keyrange.

* Added getCheckpointMetaDataForRange.

* Minor fixes for NativeAPI.actor.cpp.

* Replace UID CheckpointMetaData::ssId with std::vector<UID>
CheckpointMetaData::src;

* Implemented getCheckpointMetaData() and completed checkpoint creation
and fetch in test.

* Refactoring CheckpointRequest and CheckpointMetaData

rename `dataMoveId` as `actionId` and make it Optional.

* Fixed ctor of CheckpointMetaData.

* Implemented ShardedRocksDB::restore().

* Tested checkpoint restore, and added range check for restore, so that
the target ranges can be a subset of the checkpoint ranges.

* Added test to partially restore a checkpoint.

* Refactor: added checkpointRestore().

* Sort ranges for comparison.

* Cleanups.

* Check restore ranges are empty; Add ranges in main thread.

* Resolved comments.

* Fixed GetCheckpointMetaData range check issue.

* Refactor CheckpointReader for CF checkpoint.

* Added CheckpointAsKeyValues as a parameter for newCheckpointReader.

* PhysicalShard::restoreKvs().

* Added `ranges` in fetchCheckpoint.

* Added RocksDBCheckpointKeyValues::ranges.

* Added ICheckpointIterator and implemented for RocksDBCheckpointReader.

* Refactored OpenAction for CheckpointReader, handled failure cases.

* Use RocksDBCheckpointIterator::end() in readRange.

* Set CheckpointReader timout and other Rocks read options.

* Implementing fetchCheckpointRange().

* Added more CheckpointReader tests.

* Cleanup.

* More cleanup.

* Resolved comments.

Co-authored-by: He Liu <heliu@apple.com>
2022-12-14 17:44:47 -08:00
neethuhaneesha 3a4d79cb8b
Moving rocksdb read iterator destruction from commit path to actor. (#8970) 2022-12-12 13:46:43 -08:00
He Liu 3d2124df80
Checkpoint restore sharded rocks (#8758)
* Allow multiple keyranges in CheckpointRequest.
Include DataMove ID in CheckpointMetaData.

* Use UID dataMoveId instead of Optional<UID>.

* Implemented ShardedRocks::checkpoint().

* Implementing createCheckpoint().

* Attempted to change getCheckpointMetaData*() for a single keyrange.

* Added getCheckpointMetaDataForRange.

* Minor fixes for NativeAPI.actor.cpp.

* Replace UID CheckpointMetaData::ssId with std::vector<UID>
CheckpointMetaData::src;

* Implemented getCheckpointMetaData() and completed checkpoint creation
and fetch in test.

* Refactoring CheckpointRequest and CheckpointMetaData

rename `dataMoveId` as `actionId` and make it Optional.

* Fixed ctor of CheckpointMetaData.

* Implemented ShardedRocksDB::restore().

* Tested checkpoint restore, and added range check for restore, so that
the target ranges can be a subset of the checkpoint ranges.

* Added test to partially restore a checkpoint.

* Refactor: added checkpointRestore().

* Sort ranges for comparison.

* Cleanups.

* Check restore ranges are empty; Add ranges in main thread.

* Resolved comments.

* Fixed GetCheckpointMetaData range check issue.

* Fixed error description.

Co-authored-by: He Liu <heliu@apple.com>
2022-11-30 08:22:14 -08:00
Yao Xiao 7eda37ea8d
Increase field length limit for rocksdb errors. (#8944) 2022-11-29 13:12:06 -08:00
sfc-gh-tclinkenbeard 3c97f43138 Change Histogram::Unit::microseconds to milliseconds 2022-11-21 08:03:56 -08:00
Jingyu Zhou 2a74624cbd
Merge pull request #8848 from neethuhaneesha/suggest-compacts
Rocksdb suggest compact range checks
2022-11-17 20:01:19 -08:00
neethuhaneesha d865e77f06
RocksDB 7.7.3 version upgrade (#8858) 2022-11-17 15:39:22 -08:00
Jingyu Zhou 186d30be95
Merge pull request #8823 from xumengpanda/mengxu/main-tmp
Increase memtable and writebuffer size for rocksdb simulation test
2022-11-17 14:45:14 -08:00
neethuhaneesha b46c9eb67d Rocksdb suggest compact range checks 2022-11-17 14:20:18 -08:00
Meng Xu 68eb129c71 RocksDB:Use knob to control readValueTimeout value in simulation 2022-11-14 16:24:28 -08:00
Sam Gwydir 7ea42841a4 Merge remote-tracking branch 'origin/main' into ddsketch 2022-11-12 13:52:57 -08:00
Sam Gwydir 23706c957b Use DDSketch for Sample Data. 2022-11-12 13:45:46 -08:00
neethuhaneesha 18c75e18a6
Adding counters for singlekey clear requests (#8747) 2022-11-10 20:04:20 -08:00
He Liu 34da5e25a2
Allow multiple keyranges in CheckpointRequest. (#8743)
* Allow multiple keyranges in CheckpointRequest.
Include DataMove ID in CheckpointMetaData.

* Use UID dataMoveId instead of Optional<UID>.

Co-authored-by: He Liu <heliu@apple.com>
2022-11-09 11:18:58 -08:00
neethuhaneesha ca33fe1f1e
Rocksdb stats level knob. (#8711) 2022-11-07 22:32:48 -08:00
He Liu d28187ca90
Do not set timeout for RocksDB reads in simulation. (#8716)
* Do not set timeout for RocksDB reads in simulation.

* Cleanup.

* Ignore validateStorage test.
2022-11-07 15:59:52 -08:00
neethuhaneesha 1daa346cb4
Adding boundaries to rocksdb read iterator pool. (#8584) 2022-11-03 10:26:47 -07:00
Xiaoge Su f1eca6d672 fixup! Fix compile error 2022-11-01 10:36:25 -07:00
Xiaoge Su 520a14cd72 fixup! update code per comments 2022-11-01 10:36:25 -07:00
Xiaoge Su 74de1aaa8d Redirect RocksDB Log data to FDB TraceEvent
RocksDB supports injecting a custom logger. By introducing
RocksDBLogForwarder, it is possible to retrieve RocksDB log lines and
log them as TraceEvents.

Note that RocksDB is multi-threaded while FDB is designed to be
single threaded, in the FDB event loop there are certain variables
defined as thread_local. This causes that only FDB main thread could
generate TraceEvent, since information like Machine are only available
in the main thread. The current design is to cache all log lines from
the other threads, and let the main thread report the cached log, when:

  * The main thread received log
  * Every some time (this should be a Knob but at this stage a magic
    number is used for convenience.)

It is possible to parse the log lines into Key/Value pairs for
TraceEvent output, but at this stage only the format string is printed
out. Also, RocksDB may log some errors that are interpreted as SevError,
which will cause simulation failures. To prevent this, the maximum error
level is set to SevWarn, which should be reconsidered carefully.

The code is tested by 1) random simulations to ensure the log lines are
included in the XML files 2) force the simulator uses RocksDB and run a
10k correctness run. Both tests passed.
2022-11-01 10:36:25 -07:00
neethuhaneesha a1eb1d4a48
Rocksdb storage using single_key_deletes instead of deleterange on clearrange operation. (#8452) 2022-10-21 15:47:19 -07:00
neethuhaneesha 3db0c786e5 RocksDB commit latency sample corrections. 2022-10-12 16:19:49 -07:00
neethuhaneesha 4b238e3985
RocksDB disable WAL for experimentation. (#8443) 2022-10-10 12:32:05 -07:00
He Liu 88c37c81d8 Merge branch 'main' of https://github.com/apple/foundationdb into thread-priority 2022-10-05 14:20:53 -07:00
Markus Pilman 0361cf74e5 fix RocksDB compilation errors 2022-10-05 09:21:15 -06:00
Markus Pilman 550488b020 Merge remote-tracking branch 'origin/main' into bugfixes/open-for-ide
# Conflicts:
#	bindings/c/CMakeLists.txt
#	fdbclient/include/fdbclient/GetEncryptCipherKeys.actor.h
#	fdbserver/BackupWorker.actor.cpp
#	fdbserver/BlobWorker.actor.cpp
#	fdbserver/CommitProxyServer.actor.cpp
#	fdbserver/KeyValueStoreMemory.actor.cpp
#	fdbserver/StorageCache.actor.cpp
#	fdbserver/include/fdbserver/GetEncryptCipherKeys.actor.h
#	fdbserver/storageserver.actor.cpp
#	fdbserver/workloads/PhysicalShardMove.actor.cpp
#	flow/CMakeLists.txt
2022-10-04 18:27:48 -06:00
neethuhaneesha a565863189
RocksDB compaction knobs and stats. (#8392) 2022-10-04 15:13:50 -07:00
A.J. Beamon e1fe28b78b Switch some usages of LiteralStringRef to use the _sr suffix 2022-09-30 16:04:16 -07:00
He Liu 5f975623fb Merge branch 'main' of https://github.com/apple/foundationdb into thread-priority 2022-09-30 08:57:53 -07:00
He Liu 63b8d775a3
Knob for RocksDb behaviors (#8360)
* Added knob for rocksdb suggest compact.

* Added ROCKSDB_LEVEL_COMPACTION_DYNAMIC_LEVEL_BYTES knob.

Co-authored-by: He Liu <heliu@apple.com>
2022-09-29 15:40:29 -07:00
A.J. Beamon 4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
He Liu 2e2c198df7 Added knobs for RocksDB reader/writer thread priorities. 2022-09-19 11:20:17 -07:00
Fuheng Zhao 7c6dbaf3cf update trState ReadOption to optional 2022-08-24 15:04:17 -07:00
Fuheng Zhao 4e748d6bed use optional ReadOptions and RangeReadOptions in requests 2022-08-23 17:16:47 -07:00
Fuheng Zhao 78f4b4f739 add RangReadOptions which inherit from ReadOptions 2022-08-22 11:46:01 -07:00
Fuheng Zhao d24a52952c update readOption struct 2022-08-10 10:16:26 -07:00
Fuheng Zhao 1a5b8fbd30 resolve conflicts 2022-08-09 09:57:11 -07:00
Fuheng Zhao e4fb565057 use readOptions to pass type and cacheResult 2022-08-08 15:30:56 -07:00
He Liu a2dc4e20e9
Store rocksdb::DBOptions and rocksdb::ColumnFamilyOptions to (#7766)
* Store rocksdb::DBOptions and rocksdb::ColumnFamilyOptions to
SharedRocksDBState.

* Make KeyValueStoreRocksDBTest.toml `UNIT`.

* Added TEST_STORAGE_ENGINE_TYPE

* Added readOptions.
2022-08-08 13:38:02 -07:00
He Liu 118c2ae806
Fixed memory leak for RocksDb and CheckpointReader. (#7665)
* Fixed memory leak for RocksDb and CheckpointReader.

* Close kvStore at the end of StorageServerCheckpointRestoreTest.
2022-07-25 12:36:29 -07:00
neethuhaneesha 3cbb51de21 Adding rocksdb compression and data size stats. 2022-07-14 11:28:20 -07:00
neethuhaneesha d80506fd21 Adding logId to trace events. 2022-06-27 10:41:05 -07:00
neethuhaneesha 410ab6352f Traceevent correction. 2022-06-01 15:21:15 -07:00
He Liu 78dc7c5d77 Resolving comments. 2022-05-19 13:27:21 -07:00
He Liu 54c566e57d Drop RocksDB column family before create a new column family from
import.
2022-05-19 13:27:21 -07:00
He Liu 05bbe174c3 Implemented checkpoint(), restore() for KeyValueStoreRocksDB, for the
new format.
2022-05-19 13:27:21 -07:00