Skip to content

stop pushing maxwell.bootstrap table events #1390

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions src/main/java/com/zendesk/maxwell/filtering/Filter.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public Filter(String maxwellDB, String filterString) throws InvalidFilterExcepti
}

public boolean isSystemWhitelisted(String database, String table) {
return isMaxwellDB(database)
&& ("bootstrap".equals(table) || "heartbeats".equals(table));
return isMaxwellDB(database) && ("bootstrap".equals(table) || "heartbeats".equals(table));
}

public boolean isMaxwellDB(String database) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private void checkCommErrors() throws ServerException {
}

private boolean shouldSkipRow(RowMap row) throws IOException {
if ( isMaxwellRow(row) && !isBootstrapInsert(row))
if (isMaxwellRow(row))
return true;

/* NOTE: bootstrapper.shouldSkip will block us if
Expand Down Expand Up @@ -349,7 +349,7 @@ private void processQueryEvent(BinlogConnectorEvent event) throws Exception {
* Should we output a batch of rows for the given database and table?
*
* First against a whitelist/blacklist/filter. The whitelist
* ensures events that maxwell needs (maxwell.bootstrap, maxwell.heartbeats)
* ensures events that maxwell needs (maxwell.heartbeats)
* are always passed along.
*
* The system the blacklist gets rid of the
Expand Down Expand Up @@ -399,11 +399,6 @@ protected boolean isMaxwellRow(RowMap row) {
return row.getDatabase().equals(this.maxwellSchemaDatabaseName);
}

private boolean isBootstrapInsert(RowMap row) {
return row.getDatabase().equals(this.maxwellSchemaDatabaseName)
&& row.getRowType().equals("insert")
&& row.getTable().equals("bootstrap");
}

private void ensureReplicatorThread() throws Exception {
checkCommErrors();
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/sql/json/bootstrap-multiple-row
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ insert into maxwell.bootstrap set database_name = 'shard_1', table_name = 'minim
-> { database: "shard_1", table: "minimal", type: "insert", data: {id: 1, account_id: 1, text_field: "hello"} }
-> { database: "shard_1", table: "minimal", type: "insert", data: {id: 2, account_id: 2, text_field: "bonjour"} }
-> { database: "shard_1", table: "minimal", type: "insert", data: {id: 3, account_id: 3, text_field: "goeiedag"} }
-> { database: "maxwell", table: "bootstrap", type: "insert", data: {id: 1, database_name: "shard_1", table_name: "minimal", is_complete: 0, inserted_rows: 0, binlog_position:0, total_rows: 0, created_at: null, started_at: null, completed_at: null, binlog_file: null, where_clause: null, client_id: "maxwell" }}
-> { database: "shard_1", table: "minimal", type: "bootstrap-start", data: {} }
-> { database: "shard_1", table: "minimal", type: "bootstrap-insert", data: {id: 1, account_id: 1, text_field: "hello" } }
-> { database: "shard_1", table: "minimal", type: "bootstrap-insert", data: {id: 2, account_id: 2, text_field: "bonjour"} }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ insert into minimal set account_id = 1, text_field='hello';
insert into minimal set account_id = 2, text_field='bonjour';
insert into minimal set account_id = 3, text_field='goeiedag';
insert into maxwell.bootstrap set database_name = 'shard_1', table_name = 'minimal', where_clause = 'id > 1';
-> { database: "maxwell", table: "bootstrap", type: "insert", data: {id: 1, database_name: "shard_1", table_name: "minimal", is_complete: 0, inserted_rows: 0, binlog_position:0, total_rows: 0, created_at: null, started_at: null, completed_at: null, binlog_file: null, where_clause: "id > 1", client_id: "maxwell" }}
-> { database: "shard_1", table: "minimal", type: "bootstrap-start", data: {} }
-> { database: "shard_1", table: "minimal", type: "bootstrap-insert", data: {id: 2, account_id: 2, text_field: "bonjour"} }
-> { database: "shard_1", table: "minimal", type: "bootstrap-insert", data: {id: 3, account_id: 3, text_field: "goeiedag"} }
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/sql/json/bootstrap-single-row
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ insert into minimal set account_id = 1, text_field='hello'
insert into maxwell.bootstrap set database_name = 'shard_1', table_name = 'minimal'

-> { database: "shard_1", table: "minimal", type:"insert", data: { id: 1, account_id: 1, text_field: "hello"} }
-> { database: "maxwell", table: "bootstrap",type: "insert", data: { database_name: "shard_1", inserted_rows: 0, total_rows: 0, binlog_position: 0, id: 1, is_complete: 0, table_name: "minimal", created_at: null, started_at: null, completed_at: null, binlog_file: null, where_clause: null, client_id: "maxwell" } }
-> { database: "shard_1", table: "minimal", type: "bootstrap-start", data: {} }
-> { database: "shard_1", table: "minimal", type: "bootstrap-insert", data: { id: 1, account_id: 1, text_field: "hello"} }
-> { database: "shard_1", table: "minimal", type: "bootstrap-complete", data: {}}
1 change: 0 additions & 1 deletion src/test/resources/sql/json/bootstrap-whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ insert into shard_1.minimal set account_id = 1, text_field='hello'
insert into maxwell.bootstrap set database_name = 'shard_1', table_name = 'minimal'

-> { database: "shard_1", table: "minimal", type:"insert", data: { id: 1, account_id: 1, text_field: "hello"} }
-> { database: "maxwell", table: "bootstrap",type: "insert", data: { database_name: "shard_1", inserted_rows: 0, total_rows: 0, binlog_position: 0, id: 1, is_complete: 0, table_name: "minimal", created_at: null, started_at: null, completed_at: null, binlog_file: null, where_clause: null, client_id: "maxwell" } }
-> { database: "shard_1", table: "minimal", type: "bootstrap-start", data: {} }
-> { database: "shard_1", table: "minimal", type: "bootstrap-insert", data: { id: 1, account_id: 1, text_field: "hello"} }
-> { database: "shard_1", table: "minimal", type: "bootstrap-complete", data: {}}