Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trustpilot #1

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
102eed0
tp
Feb 9, 2018
be46e25
enrich set transaction with document state
Feb 9, 2018
b8f5e84
Merge pull request #2 from trustpilot/set-transaction-enricher
raimondast Feb 9, 2018
d543e9c
filter fields SMT
Feb 20, 2018
578507a
Merge pull request #4 from trustpilot/filter-fields-smt
raimondast Feb 20, 2018
3e6f1f1
SMT to fallback message keys to legacy debezium mongodb format
Feb 22, 2018
500b586
Merge pull request #5 from trustpilot/fallback-to-legacy-keys-smt
raimondast Feb 23, 2018
2f56e64
handle tombstone events (#6)
TPRobots Feb 26, 2018
81ceb9e
fix mem-leak that occurs on large events from oplog (#8)
raimondast Jul 2, 2018
9b27188
DBZ-627 Unifying TopicSelector implementations
gunnarmorling Jul 17, 2018
4821205
DBZ-627 Using unfified TopicSelector for MongoDB, too
gunnarmorling Jul 18, 2018
f23f053
DBZ-796 Do not create new image dirs when exists
jpechane Jul 20, 2018
6ebcbcd
DBZ-800 Removing unused method from Heartbeat
gunnarmorling Jul 17, 2018
bd73591
DBZ-800 Emitting heartbeat events in Postgres streaming loop
gunnarmorling Jul 18, 2018
b38aeab
DBZ-800 Avoiding "mysql" in commonly used heartbeat key schema
gunnarmorling Jul 20, 2018
3ac63d5
DBZ-800 Adding test for receiving heartbeat events with Postgres
gunnarmorling Jul 20, 2018
724f5c5
[release] Changelog for 0.8.1
jpechane Jul 25, 2018
9570f52
[maven-release-plugin] prepare release v0.8.1.Final
Jul 25, 2018
bad917a
[maven-release-plugin] prepare for next development iteration
Jul 25, 2018
e7034b2
update mongo driver
Jul 31, 2018
dd50dee
Increate mongo driver version to 3.6.4
Jul 31, 2018
f3bb60d
Fix for incorrect MongoDB "Primary changed" event handling
Aug 2, 2018
c4396cf
Fix for incorrect MongoDB "Primary changed" event handling
Aug 2, 2018
6dcdd86
Merge pull request #9 from trustpilot/PrimaryChanged
Aug 2, 2018
8d6113d
DBZ-838 Adding condition to interrupt initial sync if task is stopped
jchipmunk Jul 26, 2018
6fb0505
DBZ-838 Formatting
gunnarmorling Jul 27, 2018
65ffbd2
DBZ-860 Handle implicitly NOT NULL PKs
jpechane Aug 16, 2018
6955197
DBZ-860 Expanding test
gunnarmorling Aug 20, 2018
da7b37f
DBZ-866 Add schema, database and table to Postgres connector
oripwk Aug 18, 2018
4acb284
DBZ-866 PR fixes
oripwk Aug 21, 2018
36463a1
DBZ-866 Adding Ori Popowski to COPYRIGHT.txt
gunnarmorling Aug 22, 2018
fc533b8
DBZ-860 Fix for primary keys with default value
jpechane Aug 20, 2018
6aefcf2
DBZ-860 DBZ-869 Enable default value tests for antlr parser
jpechane Aug 21, 2018
ec59718
DBZ-870 Accept zero as valid date/time value
jpechane Aug 21, 2018
6fe21a8
DBZ-870 Adding test
gunnarmorling Aug 23, 2018
20087c5
DBZ-877 Process newly added columns
jpechane Aug 23, 2018
fd1dfcc
DBZ-880 MySQLConnectorTask no longer always reports finding the binlog
CliffWheadon Aug 27, 2018
e001a70
DBZ-880 Adding Cliff Wheadon to COPYRIGHT.txt
gunnarmorling Aug 28, 2018
a271f0c
Changelog for 0.8.2
jpechane Aug 30, 2018
f7e1681
[maven-release-plugin] prepare release v0.8.2
Aug 30, 2018
e0154a9
[maven-release-plugin] prepare for next development iteration
Aug 30, 2018
683d7e8
DBZ-907 Log refreshing schema due to different column count
jpechane Sep 11, 2018
231538c
DBZ-908 Removing obsolete config parameters: DATABASE_LIST_NAME and C…
jchipmunk Sep 12, 2018
bc78682
DBZ-901 Handle default date/time values without micros
jpechane Sep 10, 2018
3f77568
DBZ-903 Support function named DATABASE()
jpechane Sep 10, 2018
65f0df8
DBZ-784 Terminate execute loops during shutdown
jpechane Sep 18, 2018
7bfa263
DBZ-784 Changing var name
gunnarmorling Sep 18, 2018
45adee4
DBZ-769 Try to release table locks during exception
jpechane Sep 18, 2018
80c85ac
DBZ-784 Correct condition for stopped running projection
jpechane Sep 18, 2018
b7b1971
DBZ-910 Improve support for CHECK constraint
jpechane Sep 18, 2018
107ce06
DBZ-910 Verify also anonymous CONSTRAINT CHECK
jpechane Sep 18, 2018
a29f290
DBZ-862 Handle concurrent transaction blocking taking snapshot
jpechane Aug 23, 2018
a608dcc
DBZ-862 Fix Travis timing issue
jpechane Aug 24, 2018
58eb553
DBZ-862 Fix test interdependency problem
jpechane Aug 24, 2018
26232cb
DBZ-862 Extracting values for controlling retry attempts into constants
gunnarmorling Sep 3, 2018
5ffd761
DBZ-862 Backport prepared statement support
jpechane Sep 19, 2018
ece82de
DBZ-899 Removing unused field;
gunnarmorling Sep 18, 2018
18f871c
DBZ-899 Using custom statement to obtain SQL type info in order to av…
gunnarmorling Sep 18, 2018
d210fb5
fix gitd bug
PengLyu Jul 25, 2018
9c9830b
DBZ-857 Ability to rewrites deleted records
maver1ck Aug 13, 2018
8a463b5
DBZ-895 Make tcpKeepalive enabled by default
jpechane Sep 10, 2018
1e95d60
DBZ-887 Close connection even for non-started producer
jpechane Aug 31, 2018
ac52d6e
Changelog for 0.8.3.Final
jpechane Sep 19, 2018
2d79160
[maven-release-plugin] prepare release v0.8.3.Final
Sep 19, 2018
e581713
Backported fix from https://github.com/debezium/debezium/pull/527/fil…
TPRobots Oct 18, 2018
ac38a59
Support unset operators (#12)
TPRobots Nov 12, 2018
4e5e4f2
Merge commit Release 0.8.3.Final 2d79160d981d6c3cdf154edbdb3264d18f02…
Nov 20, 2018
74de89c
Added explicit Trustpilot version.
Nov 22, 2018
f4458cf
Docks synced marker (#15)
TPRobots Dec 4, 2018
0f196f7
handle oplog event with unknow ops
raimondast Sep 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
language: java
cache:
directories:
- $HOME/.m2/repository

sudo: required

jdk:
- oraclejdk8

services:
- docker

# First stop MySQL and PostgreSQL that run by default (see DBZ-163). Then check Docker status. Finally,
# install Maven 3.3.9, since the Jolokia Maven plugin requires 3.2.1 or later but Travis current runs 3.1.x
before_install:
- sudo service mysql-5.6 stop || sudo service mysql stop
- sudo /etc/init.d/postgresql stop
- docker -v
- docker ps -a
- wget https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip
- unzip -qq apache-maven-3.3.9-bin.zip
- export M2_HOME=$PWD/apache-maven-3.3.9
- export PATH=$M2_HOME/bin:$PATH
- mvn -version

# By default Travis will install dependencies before it runs a build, and with Maven projects that
# means running an install build without tests. We don't need to do this, and it actually causes problems.
# So skip it...
install: true

after_install:
- docker ps -a

script:
- mvn clean install -Passembly -Dversion.postgres.server=9.6-devel
- mvn install -pl debezium-connector-mysql -Pparser-antlr -DskipTests
- mvn install -pl debezium-connector-postgres -Pwal2json-decoder -Dversion.postgres.server=9.6-devel
- mvn install -pl debezium-connector-mongodb -Dversion.mongo.server=3.2.19

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/44c51b6da8c2bec32645
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
#language: java
#cache:
# directories:
# - $HOME/.m2/repository
#
#sudo: required
#
#jdk:
# - oraclejdk8
#
#services:
# - docker
#
## First stop MySQL and PostgreSQL that run by default (see DBZ-163). Then check Docker status. Finally,
## install Maven 3.3.9, since the Jolokia Maven plugin requires 3.2.1 or later but Travis current runs 3.1.x
#before_install:
# - sudo service mysql-5.6 stop || sudo service mysql stop
# - sudo /etc/init.d/postgresql stop
# - docker -v
# - docker ps -a
# - wget https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip
# - unzip -qq apache-maven-3.3.9-bin.zip
# - export M2_HOME=$PWD/apache-maven-3.3.9
# - export PATH=$M2_HOME/bin:$PATH
# - mvn -version
#
## By default Travis will install dependencies before it runs a build, and with Maven projects that
## means running an install build without tests. We don't need to do this, and it actually causes problems.
## So skip it...
#install: true
#
#after_install:
# - docker ps -a
#
#script:
# - mvn clean install -Passembly -Dversion.postgres.server=9.6-devel
# - mvn install -pl debezium-connector-mysql -Pparser-antlr -DskipTests
# - mvn install -pl debezium-connector-postgres -Pwal2json-decoder -Dversion.postgres.server=9.6-devel
# - mvn install -pl debezium-connector-mongodb -Dversion.mongo.server=3.2.19
#
#notifications:
# webhooks:
# urls:
# - https://webhooks.gitter.im/e/44c51b6da8c2bec32645
# on_success: always # options: [always|never|change] default: always
# on_failure: always # options: [always|never|change] default: always
# on_start: never # options: [always|never|change] default: always
88 changes: 88 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,94 @@

All notable changes are documented in this file. Release numbers follow [Semantic Versioning](http://semver.org)

## 0.8.3.Final
September 19th, 2018 [Detailed release notes](https://issues.jboss.org/secure/ReleaseNote.jspa?projectId=12317320&version=12339197)

### New features since 0.8.2.Final

* Ability to rewrite deleted records [DBZ-857](https://issues.jboss.org/browse/DBZ-857)
* use tcpKeepAlive by default [DBZ-895](https://issues.jboss.org/browse/DBZ-895)

### Breaking changes since 0.8.2.Final

There are no breaking changes in this release.


### Fixes since 0.8.2.Final

* Global read lock not release when exception raised during snapshot [DBZ-769](https://issues.jboss.org/browse/DBZ-769)
* Abort loops in MongoPrimary#execute() if the connector is stopped [DBZ-784](https://issues.jboss.org/browse/DBZ-784)
* GtidModeEnabled method check gtid mode will always be true [DBZ-820](https://issues.jboss.org/browse/DBZ-820)
* Sensitive vars CONNECT_CONSUMER_SASL_JAAS_CONFIG and CONNECT_PRODUCER_SASL_JAAS_CONFIG are printed to the log [DBZ-861](https://issues.jboss.org/browse/DBZ-861)
* A new replication slot waits for all concurrent transactions to finish [DBZ-862](https://issues.jboss.org/browse/DBZ-862)
* Execution of RecordsStreamProducer.closeConnections() is susceptible to race condition [DBZ-887](https://issues.jboss.org/browse/DBZ-887)
* PostgresConnection.initTypeRegistry() takes ~24 mins [DBZ-899](https://issues.jboss.org/browse/DBZ-899)
* java.time.format.DateTimeParseException: Text '1970-01-01 00:00:00' in mysql ALTER [DBZ-901](https://issues.jboss.org/browse/DBZ-901)
* org.antlr.v4.runtime.NoViableAltException on CREATE DEFINER=`web`@`%` PROCEDURE `... [DBZ-903](https://issues.jboss.org/browse/DBZ-903)
* RecordsStreamProducer should report refresh of the schema due to different column count [DBZ-907](https://issues.jboss.org/browse/DBZ-907)
* MongoDbConnector returns obsolete config values during validation [DBZ-908](https://issues.jboss.org/browse/DBZ-908)
* Can't parse create definition on the mysql connector [DBZ-910](https://issues.jboss.org/browse/DBZ-910)


### Other changes since 0.8.2.Final

None


## 0.8.2.Final
August 30th, 2018 [Detailed release notes](https://issues.jboss.org/secure/ReleaseNote.jspa?projectId=12317320&version=12338793)

### New features since 0.8.1.Final

* Postgres connector - add database, schema and table names to "source" section of records [DBZ-866](https://issues.jboss.org/browse/DBZ-866)


### Breaking changes since 0.8.1.Final

There are no breaking changes in this release.


### Fixes since 0.8.1.Final

* Initial synchronization is not interrupted [DBZ-838](https://issues.jboss.org/browse/DBZ-838)
* DDL parsing in MySQL - default value of primary key is set to null [DBZ-860](https://issues.jboss.org/browse/DBZ-860)
* Antlr DDL parser exception for "create database ... CHARSET=..." [DBZ-864](https://issues.jboss.org/browse/DBZ-864)
* Missing 0.8.1.Final tags for Zookeper and Kafka [DBZ-868](https://issues.jboss.org/browse/DBZ-868)
* AlterTableParserListener does not remove column definition listeners [DBZ-869](https://issues.jboss.org/browse/DBZ-869)
* MySQL parser does not recognize 0 as default value for date/time [DBZ-870](https://issues.jboss.org/browse/DBZ-870)
* A new column might not be added with ALTER TABLE antlr parser [DBZ-877](https://issues.jboss.org/browse/DBZ-877)
* MySQLConnectorTask always reports it has the required Binlog file from MySQL [DBZ-880](https://issues.jboss.org/browse/DBZ-880)


### Other changes since 0.8.1.Final

None


## 0.8.1.Final
July 25th, 2018 [Detailed release notes](https://issues.jboss.org/secure/ReleaseNote.jspa?projectId=12317320&version=12338169)

### New features since 0.8.0.Final

None


### Breaking changes since 0.8.0.Final

There are no breaking changes in this release.


### Fixes since 0.8.0.Final

* PostgreSQL LSNs are not committed when receiving events for filtered-out tables [DBZ-800](https://issues.jboss.org/browse/DBZ-800)


### Other changes since 0.8.0.Final

* Extract common TopicSelector contract [DBZ-627](https://issues.jboss.org/browse/DBZ-627)
* Remove redundant Docker configuration [DBZ-796](https://issues.jboss.org/browse/DBZ-796)


## 0.8.0.Final
July 11th, 2018 [Detailed release notes](https://issues.jboss.org/secure/ReleaseNote.jspa?projectId=12317320&version=12338151)

Expand Down
2 changes: 2 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Ben Williams
Brandon Maguire
Chris Riccomini
Christian Posta
Cliff Wheadon
David Chen
David Leibovic
David Szabo
Expand All @@ -35,6 +36,7 @@ Matteo Capitanio
Matthias Wessendorf
Olavi Mustanoja
Omar Al-Safi
Ori Popowski
Orr Ganani
Peter Goransson
Prannoy Mittal
Expand Down
2 changes: 1 addition & 1 deletion debezium-assembly-descriptors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.debezium</groupId>
<artifactId>debezium-parent</artifactId>
<version>0.9.0-SNAPSHOT</version>
<version>0.8.3.Final</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 2 additions & 0 deletions debezium-connector-mongodb/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#TP

# Ingesting MongoDB change events

This module defines the connector that ingests change events from MongoDB databases.
Expand Down
2 changes: 1 addition & 1 deletion debezium-connector-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>io.debezium</groupId>
<artifactId>debezium-parent</artifactId>
<version>0.9.0-SNAPSHOT</version>
<version>0.8.3.Final.tp-SANPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import java.util.regex.Pattern;

import io.debezium.annotation.Immutable;
import io.debezium.schema.DataCollectionId;

/**
* A simple identifier for collections in a replica set.
*
* @author Randall Hauch
*/
@Immutable
public final class CollectionId {
public final class CollectionId implements DataCollectionId {

private static final Pattern IDENTIFIER_SEPARATOR_PATTERN = Pattern.compile("\\.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
Expand Down Expand Up @@ -222,6 +223,7 @@ public static class MongoPrimary {
private final Supplier<MongoClient> primaryConnectionSupplier;
private final Filters filters;
private final BiConsumer<String, Throwable> errorHandler;
private final AtomicBoolean running = new AtomicBoolean(true);

protected MongoPrimary(ConnectionContext context, ReplicaSet replicaSet, Filters filters, BiConsumer<String, Throwable> errorHandler) {
this.replicaSet = replicaSet;
Expand Down Expand Up @@ -272,6 +274,9 @@ public void execute(String desc, Consumer<MongoClient> operation) {
return;
} catch (Throwable t) {
errorHandler.accept(desc, t);
if (!isRunning()) {
throw new ConnectException("Operation failed and MongoDB primary termination requested", t);
}
try {
errorMetronome.pause();
}
Expand Down Expand Up @@ -299,6 +304,9 @@ public <T> T execute(String desc, Function<MongoClient, T> operation) {
}
catch (Throwable t) {
errorHandler.accept(desc, t);
if (!isRunning()) {
throw new ConnectException("Operation failed and MongoDB primary termination requested", t);
}
try {
errorMetronome.pause();
}
Expand All @@ -324,8 +332,15 @@ public void executeBlocking(String desc, BlockingConsumer<MongoClient> operation
try {
operation.accept(primary);
return;
} catch (Throwable t) {
}
catch (InterruptedException e) {
throw e;
}
catch (Throwable t) {
errorHandler.accept(desc, t);
if (!isRunning()) {
throw new ConnectException("Operation failed and MongoDB primary termination requested", t);
}
errorMetronome.pause();
}
}
Expand Down Expand Up @@ -382,6 +397,17 @@ public List<CollectionId> collections() {
return collections;
});
}

private boolean isRunning() {
return running.get();
}

/**
* Terminates the execution loop of the current primary
*/
public void stop() {
running.set(false);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
*/
public class MongoDbConnectorConfig extends CommonConnectorConfig {

private static final String DATABASE_LIST_NAME = "database.list";
private static final String COLLECTION_LIST_NAME = "collection.list";

/**
* The comma-separated list of hostname and port pairs (in the form 'host' or 'host:port') of the MongoDB servers in the
* replica set.
Expand All @@ -34,7 +31,6 @@ public class MongoDbConnectorConfig extends CommonConnectorConfig {
.withType(Type.LIST)
.withWidth(Width.LONG)
.withImportance(Importance.HIGH)
.withDependents(DATABASE_LIST_NAME)
.withValidation(MongoDbConnectorConfig::validateHosts)
.withDescription("The hostname and port pairs (in the form 'host' or 'host:port') "
+ "of the MongoDB server(s) in the replica set.");
Expand All @@ -55,15 +51,13 @@ public class MongoDbConnectorConfig extends CommonConnectorConfig {
.withType(Type.STRING)
.withWidth(Width.SHORT)
.withImportance(Importance.HIGH)
.withDependents(DATABASE_LIST_NAME)
.withDescription("Database user for connecting to MongoDB, if necessary.");

public static final Field PASSWORD = Field.create("mongodb.password")
.withDisplayName("Password")
.withType(Type.PASSWORD)
.withWidth(Width.SHORT)
.withImportance(Importance.HIGH)
.withDependents(DATABASE_LIST_NAME)
.withDescription("Password to be used when connecting to MongoDB, if necessary.");

public static final Field POLL_INTERVAL_SEC = Field.create("mongodb.poll.interval.sec")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import io.debezium.config.CommonConnectorConfig;
import io.debezium.config.Configuration;
import io.debezium.connector.common.CdcSourceTaskContext;
import io.debezium.heartbeat.Heartbeat;
import io.debezium.schema.TopicSelector;

/**
* @author Randall Hauch
Expand All @@ -17,7 +19,7 @@ public class MongoDbTaskContext extends CdcSourceTaskContext {

private final Filters filters;
private final SourceInfo source;
private final TopicSelector topicSelector;
private final TopicSelector<CollectionId> topicSelector;
private final boolean emitTombstoneOnDelete;
private final String serverName;
private final ConnectionContext connectionContext;
Expand All @@ -31,13 +33,13 @@ public MongoDbTaskContext(Configuration config) {
final String serverName = config.getString(MongoDbConnectorConfig.LOGICAL_NAME);
this.filters = new Filters(config);
this.source = new SourceInfo(serverName);
this.topicSelector = TopicSelector.defaultSelector(serverName);
this.topicSelector = MongoDbTopicSelector.defaultSelector(serverName, config.getString(Heartbeat.HEARTBEAT_TOPICS_PREFIX));
this.emitTombstoneOnDelete = config.getBoolean(CommonConnectorConfig.TOMBSTONES_ON_DELETE);
this.serverName = config.getString(MongoDbConnectorConfig.LOGICAL_NAME);
this.connectionContext = new ConnectionContext(config);
}

public TopicSelector topicSelector() {
public TopicSelector<CollectionId> topicSelector() {
return topicSelector;
}

Expand Down
Loading