You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Ke Han (Jira)" <ji...@apache.org> on 2022/12/09 00:05:00 UTC
[jira] [Updated] (CASSANDRA-18105) TRUNCATED data come back after a restart
[ https://issues.apache.org/jira/browse/CASSANDRA-18105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ke Han updated CASSANDRA-18105:
-------------------------------
Description:
When we use the TRUNCATE command to delete all data in the table, the deleted data come back after a node restart. This problem happens at all the latest releases (2.2.19, 3.0.28, 3.11.14 or 4.0.7)
h2. Steps to reproduce
start up a single node (the latest release: 2.2.19, 3.0.28, 3.11.14 or 4.0.7). Using the default configuration and execute the following cqlsh commands.
{code:java}
CREATE KEYSPACE IF NOT EXISTS ks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
CREATE TABLE ks.tb (c3 TEXT,c4 TEXT,c2 INT,c1 TEXT, PRIMARY KEY (c1, c2, c3 ));
INSERT INTO ks.tb (c3, c1, c2) VALUES ('val1','val2',1);
CREATE INDEX IF NOT EXISTS tb ON ks.tb ( c3);
TRUNCATE TABLE ks.tb;
DROP INDEX IF EXISTS ks.tb; {code}
Execute a read command
{code:java}
cqlsh> SELECT c2 FROM ks.tb;
c2
----
(0 rows) {code}
Then, we flush the node by bin/nodetool flush, shut down the node and restart the node.
When the node has started, perform the same read, and the deleted data comes back again.
{code:java}
cqlsh> SELECT c2 FROM ks.tb;
c2
----
1
(1 rows) {code}
was:
When we use the TRUNCATE command to delete all data in the table, the deleted data comes back after a node restart. This problem happens at all the latest releases (2.2.19, 3.0.28, 3.11.14 or 4.0.7)
h2. Steps to reproduce
start up a single node (the latest release: 2.2.19, 3.0.28, 3.11.14 or 4.0.7). Using the default configuration and execute the following cqlsh commands.
{code:java}
CREATE KEYSPACE IF NOT EXISTS ks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
CREATE TABLE ks.tb (c3 TEXT,c4 TEXT,c2 INT,c1 TEXT, PRIMARY KEY (c1, c2, c3 ));
INSERT INTO ks.tb (c3, c1, c2) VALUES ('val1','val2',1);
CREATE INDEX IF NOT EXISTS tb ON ks.tb ( c3);
TRUNCATE TABLE ks.tb;
DROP INDEX IF EXISTS ks.tb; {code}
Execute a read command
{code:java}
cqlsh> SELECT c2 FROM ks.tb;
c2
----
(0 rows) {code}
Then, we flush the node by bin/nodetool flush, shut down the node and restart the node.
When the node has started, perform the same read, and the deleted data comes back again.
{code:java}
cqlsh> SELECT c2 FROM ks.tb;
c2
----
1
(1 rows) {code}
> TRUNCATED data come back after a restart
> ----------------------------------------
>
> Key: CASSANDRA-18105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18105
> Project: Cassandra
> Issue Type: Bug
> Components: Tool/cqlsh, Tool/nodetool
> Reporter: Ke Han
> Priority: Normal
>
> When we use the TRUNCATE command to delete all data in the table, the deleted data come back after a node restart. This problem happens at all the latest releases (2.2.19, 3.0.28, 3.11.14 or 4.0.7)
> h2. Steps to reproduce
> start up a single node (the latest release: 2.2.19, 3.0.28, 3.11.14 or 4.0.7). Using the default configuration and execute the following cqlsh commands.
> {code:java}
> CREATE KEYSPACE IF NOT EXISTS ks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
> CREATE TABLE ks.tb (c3 TEXT,c4 TEXT,c2 INT,c1 TEXT, PRIMARY KEY (c1, c2, c3 ));
> INSERT INTO ks.tb (c3, c1, c2) VALUES ('val1','val2',1);
> CREATE INDEX IF NOT EXISTS tb ON ks.tb ( c3);
> TRUNCATE TABLE ks.tb;
> DROP INDEX IF EXISTS ks.tb; {code}
> Execute a read command
> {code:java}
> cqlsh> SELECT c2 FROM ks.tb;
> c2
> ----
> (0 rows) {code}
> Then, we flush the node by bin/nodetool flush, shut down the node and restart the node.
> When the node has started, perform the same read, and the deleted data comes back again.
> {code:java}
> cqlsh> SELECT c2 FROM ks.tb;
> c2
> ----
> 1
> (1 rows) {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org