Comments (7)
Or maybe move mFileRegistry.deleteWriters(topicPartition); inside this if statement?
from secor.
@yyejun I don't understand the failure scenario. Every thread has its own directory where it keeps log files which means that writers are not shared between threads.
from secor.
It's not the file.
It's mFileRegistry.deleteWriters(topicPartition) will cause the file be deleted when new message comes in.
This should moved to after the if statement, otherwise, when the if statement return false. Nothing happens, file is not uploaded, but deleted from FileRegistry, everything saved so far will be lost in next new message.
from secor.
Basically mFileRegistry.deleteWriters is not a recoverable operation, it need to be inside the lock/check block. Because the 2nd check can return false in edge case.
from secor.
Not sure if my explanation clear enough.
This happens when https://github.com/pinterest/secor/blob/master/src/main/java/com/pinterest/secor/uploader/Uploader.java#L209 return True,
But https://github.com/pinterest/secor/blob/master/src/main/java/com/pinterest/secor/uploader/Uploader.java#L112 return False.
So Writer deleted, but file was not uploaded. Next message will call createOrGet writer, which will cause the saved file being deleted.
from secor.
I think I start to get what you are saying. Is this the failure scenario you have in mind?
- consumer thread A saved locally data from offset 100 to 120. The committed offset is 99,
- there was a rebalancing event and the ownership of the partition transferred to consumer B who saved locally data from offset 100 to 150,
- there was another rebalancing that returned the ownership to A,
- A saves locally data from 100 to 160,
- A attempts to upload the data. It executes the logic in L209,
- B uploads the data and commits the offset that now becomes 150,
- A executes the logic in L112. Offsets 151-160 get lost.
from secor.
That's correct. It happened on a slow machine after 3 rebalance events which caused two thread has exact same file access time and then try to upload at same time.
from secor.
Related Issues (20)
- Blocking Issue when running on K8s on GCP HOT 1
- manually assign avro schema to topic HOT 1
- Crashing exception after some time HOT 1
- Cannot parse timestamp with timezone HOT 1
- Racing condition with parquet writer HOT 3
- Cannot make secor work with AWS instance profile HOT 8
- Ignore parsing exceptions HOT 2
- Expose JVM metrics when using Micrometer HOT 3
- Secor uploads (different) files with the same "name" into different "days". HOT 2
- Kuberntes OOM Error. Very High memory usage > 15gb HOT 2
- Is there any alternative to AvroParquetWriter so that we can avoid using IndexedRecord? HOT 1
- ParquetWriter write method is taking too long to write single avro message HOT 1
- A Simple Study about Configuration Java Types
- PartitionFinalizer fails when there is no data produced in the topic eventhough there are other topics with data HOT 3
- Add headers while calling schema registry for decoding messages HOT 1
- Duplicate message when partition revoking or rebalancing HOT 1
- secor-monitor container not getting started. HOT 2
- Tune file size create by Secor
- Secor with zookeerper less Kafka HOT 1
- Secor filling up local disk space with intermittent data
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 secor.