I have Cassandra model as
import uuid
from cassandra.cqlengine import columns
from cassandra.cqlengine.models import Model
class MyModel(Model):
...
...
created_at = columns.TimeUUID(primary_key=True,
clustering_order='DESC',
default=uuid.uuid1)
...
...
Recentrly app hit the uuid1 creation doesn't close files - hits file descriptor limit. I try to find the solution, but seems what options I think might be not work
- Replace
uuid1
in default withuuid4
, butTimeUUID
need time part in it, and onlyuuid1
provide that. - Relace
uuid1
withcassandra.util.uuid_from_time(time.time())
, when check the code for bothuuid1
anduuid_from_time
, both are looks same, so that also not solve the problem.
Last option is to replace TimeUUID
with Timestamp
type, but this created_at
column is primary_key
and clustering_order
, so dont know I can do that or not.
My column family has already 1,000,000+ data, so I cant just drop them.
I also want to know, what is the advantage of using TimeUUID
instead of timestamp
?