smiklosovic commented on code in PR #4825:
URL: https://github.com/apache/cassandra/pull/4825#discussion_r3265564203
##########
src/java/org/apache/cassandra/db/ColumnFamilyStore.java:
##########
@@ -1026,12 +1025,21 @@ public Descriptor newSSTableDescriptor(File directory,
SSTableFormat<?, ?> forma
public Descriptor newSSTableDescriptor(File directory, Version version)
{
- Descriptor newDescriptor = new Descriptor(version,
- directory,
- getKeyspaceName(),
- name,
- sstableIdGenerator.get());
- assert !newDescriptor.fileFor(Components.DATA).exists();
+ Descriptor newDescriptor;
+ while (true)
Review Comment:
I think that thread safety is just delegated to how
`sstableIdGenerator.get()` returns the new id, right? That is AtomicInteger,
hence increased atomically, so two threads calling this stuff will always have
different ids to check the existence of a file against.
@arvindKandpal-ksolves could you put a comment on `while(true)` about this
and that this loop is meant to be a defence against offline / online generation
for tooling's sake instead of in-process flow?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]