Coder Social home page Coder Social logo

Comments (1)

fabiog1901 avatar fabiog1901 commented on July 24, 2024

I can replicate in 21.1.3. It seems to affect table that have a composite PK only.

# Open terminal for the source
cockroach start-single-node --listen-addr :30000 --http-addr :30001 --store cockroach-data/30000 --insecure --background

cockroach sql --insecure --port 30000 <<EOF
create table t (id int, s string, ts TIMESTAMP, primary key (id, s));
-- add enterprise license
SET CLUSTER SETTING cluster.organization = 'Workshop';
SET CLUSTER SETTING enterprise.license = 'crl-0-xxxxxxxxxxxxxx';
SET CLUSTER SETTING kv.rangefeed.enabled = true;
CREATE CHANGEFEED FOR TABLE defaultdb.t INTO 'experimental-http://127.0.0.1:30004/crdbusertable' WITH updated,resolved='10s';
EOF



# Open terminal for target
cockroach start-single-node --listen-addr :30002 --http-addr :30003 --store cockroach-data/30002 --insecure --background
cockroach sql --insecure --port 30002 -e "create table t (id int, s string, ts TIMESTAMP, primary key (id, s));"
cockroach sql --insecure --port 30002 -e "select * from t;" --watch 5s


# Open terminal for cdc-sink
cdc-sink --port 30004 --conn postgresql://root@localhost:30002/defaultdb?sslmode=disable --config '[{"endpoint":"crdbusertable", "source_table":"t", "destination_database":"defaultdb", "destination_table":"t"}]'



# on source terminal:
cockroach sql --port 30000 --insecure -e "insert into t values (1, 'hello', now());"
cockroach sql --port 30000 --insecure -e "delete from t where id=1"


# on target terminal, stop the watch, it will have output 

  id |   s   |             ts
-----+-------+-----------------------------
   1 | hello | 2021-08-04 18:54:40.573866
(1 row)

and run

cockroach sql --insecure --port 30002 -e "select * from _cdc_sink.defaultdb_t;"
         nanos        | logical |     key     | after
----------------------+---------+-------------+--------
  1628103287843786000 |       0 | [1,"hello"] | null


# on CDC SINK terminal
fabio@mac: ~/projects/cdc-sink $ ./cdc-sink --port 30004 --conn postgresql://root@localhost:30002/defaultdb?sslmode=disable --config '[{"endpoint":"crdbusertable", "source_table":"t", "destination_database":"defaultdb", "destination_table":"t"}]'
2021/08/04 14:54:22 listening on [::]:30004
2021/08/04 14:54:24 crdbusertable: resolved - timestamp 1628103260894898000.0
2021/08/04 14:54:34 crdbusertable: resolved - timestamp 1628103270899540000.0
2021/08/04 14:54:44 crdbusertable: added 1 operations
2021/08/04 14:54:44 crdbusertable: resolved - timestamp 1628103281104895000.0
2021/08/04 14:54:44 crdbusertable: _CDC_SINK.defaultdb_t executed 1 operations
2021/08/04 14:54:54 crdbusertable: added 1 operations
2021/08/04 14:54:54 crdbusertable: resolved - timestamp 1628103291109468000.0
2021/08/04 14:54:54 crdbusertable: _CDC_SINK.defaultdb_t executed 1 operations
2021/08/04 14:54:54 ERROR: at or near "2": syntax error (SQLSTATE 42601)
2021/08/04 14:55:04 crdbusertable: resolved - timestamp 1628103301314464000.0
2021/08/04 14:55:04 crdbusertable: _CDC_SINK.defaultdb_t executed 1 operations
2021/08/04 14:55:04 ERROR: at or near "2": syntax error (SQLSTATE 42601)

from replicator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.