我创建了一个带有集合的表。插入一条记录并对其进行sstabledump,并在sstable中看到它的范围逻辑删除。这个墓碑有没有被移除?另外,当我在唯一的sstable上运行sstablemetadata时,它显示“估计的可删除逻辑删除”为0.5”,类似地,它显示了一个以大纪元时间作为插入时间的记录-“估计的可删除逻辑删除时间:1548384720:1”。这表示当我在有集合的表上做sstablemetadata,由于集合/列表范围的墓碑,估计的可删除逻辑删除比率和删除时间值不是真实且可靠的值吗?
CREATE TABLE ks.nmtest (
reservation_id text,
order_id text,
c1 int,
order_details map<text, text>,
PRIMARY KEY (reservation_id, order_id)
) WITH CLUSTERING ORDER BY (order_id ASC)
user@cqlsh:ks> insert into nmtest (reservation_id , order_id , c1, order_details ) values('3','3',3,{'key':'value'});
user@cqlsh:ks> select * from nmtest ;
reservation_id | order_id | c1 | order_details
----------------+----------+----+------------------
3 | 3 | 3 | {'key': 'value'}
(1 rows)
[root@localhost nmtest-e1302500201d11e983bb693c02c04c62]# sstabledump mc-5-big-Data.db
WARN 02:52:19,596 memtable_cleanup_threshold has been deprecated and should be removed from cassandra.yaml
[
{
"partition" : {
"key" : [ "3" ],
"position" : 0
},
"rows" : [
{
"type" : "row",
"position" : 41,
"clustering" : [ "3" ],
"liveness_info" : { "tstamp" : "2019-01-25T02:51:13.574409Z" },
"cells" : [
{ "name" : "c1", "value" : 3 },
{ "name" : "order_details", "deletion_info" : { "marked_deleted" : "2019-01-25T02:51:13.574408Z", "local_delete_time" : "2019-01-25T02:51:13Z" } },
{ "name" : "order_details", "path" : [ "key" ], "value" : "value" }
]
}
]
}
SSTable: /data/data/ks/nmtest-e1302500201d11e983bb693c02c04c62/mc-5-big
Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
Bloom Filter FP chance: 0.010000
Minimum timestamp: 1548384673574408
Maximum timestamp: 1548384673574409
SSTable min local deletion time: 1548384673
SSTable max local deletion time: 2147483647
Compressor: org.apache.cassandra.io.compress.LZ4Compressor
Compression ratio: 1.0714285714285714
TTL min: 0
TTL max: 0
First token: -155496620801056360 (key=3)
Last token: -155496620801056360 (key=3)
minClustringValues: [3]
maxClustringValues: [3]
Estimated droppable tombstones: 0.5
SSTable Level: 0
Repaired at: 0
Replay positions covered: {CommitLogPosition(segmentId=1548382769966, position=6243201)=CommitLogPosition(segmentId=1548382769966, position=6433666)}
totalColumnsSet: 2
totalRows: 1
Estimated tombstone drop times:
1548384720: 1
另一个问题是在nodetool tablestats输出上-切片在cassandra中指的是什么?
Average live cells per slice (last five minutes): 1.0
Maximum live cells per slice (last five minutes): 1
Average tombstones per slice (last five minutes): 1.0
Maximum tombstones per slice (last five minutes): 1
Dropped Mutations: 0
答案 0 :(得分:1)
sstablemetadata没有保存在sstable中的有关您的表的信息,因为不能保证它在运行Cassandra的系统上运行,即使能够知道如何拉操作它非常复杂其中的架构信息。
由于gc_grace_seconds
是一个表参数,而不是元数据中的参数,因此默认情况下采用0
gc宽限期,因此该直方图中列出的可放置时间将更多地是逻辑删除创建时间的直方图。默认。如果您知道自己的gc宽限期,可以将其作为-g
参数添加到sstablemetadata调用中。喜欢:
sstablemetadata -g 864000 mc-5-big-Data.db
有关工具输出的信息,请参见http://cassandra.apache.org/doc/latest/tools/sstable/sstablemetadata.html。
对于集合来说,它只是正常范围的墓碑,它包含着所有的东西。它们用于防止在重写多单元格集合的值时要求先写后读。