Skip to content

Commit 750d822

Browse files
authored
Merge pull request #119 from datastax/issue/CDM-28
Issue/cdm 28
2 parents a3cbb77 + f09fc22 commit 750d822

File tree

17 files changed

+247
-1
lines changed

17 files changed

+247
-1
lines changed

SIT/smoke/04_counters/breakData.cql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
UPDATE source.smoke_counters SET col1=col1+1 WHERE key='record2';
3+
4+
-- CDM-29 discovered that this record will "zombie"...
5+
-- fixData will not correct it, fixForce will
6+
DELETE FROM target.smoke_counters where key='record3';
7+
8+
-- change by same amount on both sides, records should match
9+
UPDATE source.smoke_counters SET col2=col2+1 WHERE key='record4';
10+
UPDATE target.smoke_counters SET col2=col2+1 WHERE key='record4';
11+
12+
-- change by different amounts, they shouuld be brought into alignment with
13+
-- source, even if that means going down
14+
UPDATE source.smoke_counters SET col2=col2+1 WHERE key='record5';
15+
UPDATE target.smoke_counters SET col2=col2+2 WHERE key='record5';
16+
17+
SELECT * FROM source.smoke_counters;
18+
SELECT * FROM target.smoke_counters;
19+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Read Record Count: 5
2+
Mismatch Record Count: 2
3+
Corrected Mismatch Record Count: 2
4+
Missing Record Count: 1
5+
Corrected Missing Record Count: 0
6+
Valid Record Count: 2
7+
Skipped Record Count: 0
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Read Record Count: 5
2+
Mismatch Record Count: 0
3+
Corrected Mismatch Record Count: 0
4+
Missing Record Count: 1
5+
Corrected Missing Record Count: 1
6+
Valid Record Count: 4
7+
Skipped Record Count: 0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Read Record Count: 5
2+
Skipped Record Count: 0
3+
Write Record Count: 5
4+
Error Record Count: 0

SIT/smoke/04_counters/cdm.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
migrateData datastax.astra.migrate.Migrate migrate.properties
2+
validateData datastax.astra.migrate.DiffData migrate.properties
3+
fixData datastax.astra.migrate.DiffData fix.properties
4+
fixForce datastax.astra.migrate.DiffData fix-force.properties
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Read Record Count: 5
2+
Mismatch Record Count: 0
3+
Corrected Mismatch Record Count: 0
4+
Missing Record Count: 0
5+
Corrected Missing Record Count: 0
6+
Valid Record Count: 5
7+
Skipped Record Count: 0

SIT/smoke/04_counters/execute.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash -e
2+
3+
workingDir="$1"
4+
cd "$workingDir"
5+
6+
/local/cdm.sh -f cdm.txt -s migrateData -d "$workingDir" > cdm.migrateData.out 2>cdm.migrateData.err
7+
/local/cdm-assert.sh -f cdm.migrateData.out -a cdm.migrateData.assert -d "$workingDir"
8+
9+
/local/cdm.sh -f cdm.txt -s validateData -d "$workingDir" > cdm.validateData.out 2>cdm.validateData.err
10+
/local/cdm-assert.sh -f cdm.validateData.out -a cdm.validateData.assert -d "$workingDir"
11+
12+
cqlsh -u $CASS_USERNAME -p $CASS_PASSWORD $CASS_CLUSTER -f $workingDir/breakData.cql > $workingDir/breakData.out 2> $workingDir/breakData.err
13+
14+
/local/cdm.sh -f cdm.txt -s fixData -d "$workingDir" > cdm.fixData.out 2>cdm.fixData.err
15+
/local/cdm-assert.sh -f cdm.fixData.out -a cdm.fixData.assert -d "$workingDir"
16+
17+
/local/cdm.sh -f cdm.txt -s fixForce -d "$workingDir" > cdm.fixForce.out 2>cdm.fixForce.err
18+
/local/cdm-assert.sh -f cdm.fixForce.out -a cdm.fixForce.assert -d "$workingDir"

SIT/smoke/04_counters/expected.cql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT key,col1,col2 FROM target.smoke_counters;

SIT/smoke/04_counters/expected.out

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
key | col1 | col2
3+
---------+-------+-------
4+
record3 | 2000 | 4000
5+
record5 | 500 | 501
6+
record2 | 11 | 20
7+
record1 | 1 | 2
8+
record4 | 10000 | 20001
9+
10+
(5 rows)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
spark.origin.host cdm-sit-cass
2+
spark.origin.port 9042
3+
spark.origin.username cassandra
4+
spark.origin.password cassandra
5+
spark.origin.keyspaceTable source.smoke_counters
6+
7+
spark.target.host cdm-sit-cass
8+
spark.target.port 9042
9+
spark.target.username cassandra
10+
spark.target.password cassandra
11+
spark.target.keyspaceTable target.smoke_counters
12+
13+
spark.numSplits 1
14+
15+
spark.query.origin key,col1,col2
16+
spark.query.types 0,2,2
17+
spark.query.origin.partitionKey key
18+
spark.query.target.id key
19+
20+
spark.counterTable.cql.index 1,2
21+
spark.counterTable.missing.force true
22+
23+
spark.target.autocorrect.missing true
24+
spark.target.autocorrect.mismatch true

0 commit comments

Comments
 (0)