Comments (3)
Hi @ChiragGangwani If you could provide further details of what you are doing, with a reproduction if possible, plus platform and RocksDB version you are using, it would make it more possible for someone to understand what might be going wrong..
from rocksdb.
Hi @alanpaxton thanks for the response. Please find the further deatils below.
RocksDB version - 8.5.4
So we are doing high amount of write in multiple db & column families in multiple thread with write batch functionality.
There is no reproduction code because it happen unexpected anytime but only with large data.
write batch size - 50 mb.
Here some configuration -
DB Creation code -
private void initDB() throws StoreInitException {
Logger.info("MapStore write batch size - " + storeProps.getWriteBatchSize());
this.options.setStatistics(new Statistics());
this.initCache();
this.options.setAllowMmapReads(true);
this.options.setInfoLogLevel(InfoLogLevel.WARN_LEVEL);
this.options.setMaxLogFileSize(1000);
this.options.setKeepLogFileNum(1);
if (storeProps.isRead()) {
createDescriptors();
try
{
this.db = RocksDB.openReadOnly(dbOptions, this.storeProps.getDbFolder(), descriptors,
columnFamilyHandles);
}
catch (RocksDBException e)
{
throw new StoreInitException(e);
}
createDescriptorHandleMap();
try {
this.mapStoreMetadata = MapStoreMetadata.deserializeMetadata(storeProps.getDbFolder());
} catch (Exception e) {
Logger.warn("Store metadata is not available, metadata operations might be slow.");
Logger.warn(e);
}
}
else
{
Utility.ensureEmptyFolder(this.storeProps.getDbFolder());
this.options.setCreateIfMissing(true);
this.options.setCreateMissingColumnFamilies(true);
try
{
this.db = RocksDB.open(options, this.storeProps.getDbFolder());
}
catch (RocksDBException e)
{
Logger.error(e);
throw new StoreInitException(e);
}
addSegments(storeProps.getSegmentList());
}
defaultColumnFamily = this.db.getDefaultColumnFamily();
logInitializingStore();
}
Cache -
synchronized private void initCache() {
storeProps.getCacheProperty().ifPresent(cacheProperties -> {
Function<String, Cache> cacheFunc = id -> CacheType.CLOCK.equals(cacheProperties.getCacheType())
? new ClockCache(cacheProperties.getCacheSize())
: new LRUCache(cacheProperties.getCacheSize());
Cache cache = cacheMap.computeIfAbsent(cacheProperties.getId(), cacheFunc);
this.blockBasedTableConfig = new BlockBasedTableConfig().setBlockCache(cache);
this.options.setWriteBufferSize(cacheProperties.getWriteBufferSize());
this.options.setTableFormatConfig(blockBasedTableConfig);
});
}
Put Operation -
public void put(Optional<String> segmentId, K key, V val) throws StoreWriteException {
byte[] keyArr = toByteArr(key);
byte[] valArr = toByteArr(val);
try {
**if(storeProps.getWriteBatchSize()>0){
putInBatch(segmentId, key, val);
}**
else {
this.db.put(getColumnFamilyHandle(segmentId), keyArr, valArr);
}
} catch (RocksDBException e) {
Logger.error(e);
throw new StoreWriteException(e);
}
}
private void putInBatch(Optional<String> segmentId, K key, V val) throws StoreWriteException {
byte[] keyArr = toByteArr(key);
byte[] valArr = toByteArr(val);
try {
writeBatch.put(getColumnFamilyHandle(segmentId), keyArr, valArr);
} catch (RocksDBException e) {
throw new StoreWriteException(e);
}
if (writeBatch.getDataSize() >= storeProps.getWriteBatchSize()) {
putBatchInDb();
}
}
private void putBatchInDb() throws StoreWriteException {
try {
if(writeBatch.count()>0){
db.write(new WriteOptions(), writeBatch);
writeBatch.clear();
}
} catch (RocksDBException e) {
throw new StoreWriteException(e);
}
}
from rocksdb.
Uploading hs_err_pid3859541.log…
Please check the crash logs for further details.
from rocksdb.
Related Issues (20)
- checkpoint directory is empty when db is empty HOT 2
- [Java] In read-only mode can't get data from blob only if there is just one checkpoint with one entry HOT 13
- Solution to the periodic slowdown of GetUpdatesSnce
- Heading typo on wiki docs: PlainTable Format HOT 1
- does rocksdb provide any monitoring metrics? HOT 1
- Java release for 9.1 HOT 2
- Feature request: rate limit compaction triggered by periodic compaction seconds/ ttl only HOT 5
- The value of 'micros/op' is not equal to 1,000,000 divided by the value of 'ops/sec' HOT 4
- Question about CompactRange behavior with option atomic_flush=true
- Segfault During compaction using FIFO Compaction style for a single CF
- Safer shutdown behaviour by deafult HOT 2
- StdLogger truncating last letter in some cases HOT 3
- High Memory Usage/ LRU cache size is not being respected HOT 16
- rocksdb abnormal exit
- Feature request: log to stderr logger + LOG file
- Serious performance loss in benchmark.sh/db_bench under multithreading (reporter_agent / rocksdb::Stats::FinishedOps) HOT 1
- Consider fixing benchmark-linux in GitHub Action and re-enable the job HOT 1
- Corruption: VersionBuilder: Cannot delete table file #75038 from level 1 since it is not in the LSM tree
- Static build does not link on MacOS Silicon
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocksdb.