Skip to content

Commit

Permalink
0003032: sym_consoler_user_hist should not be sent during registration
Browse files Browse the repository at this point in the history
to clients older than 3.8.18
  • Loading branch information
chenson42 committed Mar 30, 2017
1 parent 84f970a commit 0c6d31c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Expand Up @@ -72,6 +72,7 @@ public class TableConstants {
public static final String SYM_FILE_SNAPSHOT = "file_snapshot";
public static final String SYM_FILE_INCOMING = "file_incoming";
public static final String SYM_CONSOLE_USER = "console_user";
public static final String SYM_CONSOLE_USER_HIST = "console_user_hist";
public static final String SYM_CONSOLE_EVENT = "console_event";
public static final String SYM_EXTENSION = "extension";
public static final String SYM_MONITOR = "monitor";
Expand Down
Expand Up @@ -210,7 +210,13 @@ public void extractConfigurationStandalone(Node node, OutputStream out) {
TableConstants.SYM_MONITOR_EVENT, TableConstants.SYM_CONSOLE_EVENT);
}

protected boolean filter(boolean pre38, boolean pre37, String tableName) {
protected boolean filter(Node targetNode, String tableName) {

boolean pre37 = Version.isOlderThanVersion(targetNode.getSymmetricVersion(), "3.7.0");
boolean pre38 = Version.isOlderThanVersion(targetNode.getSymmetricVersion(), "3.8.0");

boolean pre3818 = Version.isOlderThanVersion(targetNode.getSymmetricVersion(), "3.8.18");

tableName = tableName.toLowerCase();
boolean include = true;
if (pre37 && tableName.contains(TableConstants.SYM_EXTENSION)) {
Expand All @@ -220,6 +226,10 @@ protected boolean filter(boolean pre38, boolean pre37, String tableName) {
tableName.contains(TableConstants.SYM_NOTIFICATION))) {
include = false;
}

if (pre3818 && tableName.contains(TableConstants.SYM_CONSOLE_USER_HIST)) {
include = false;
}
return include;
}

Expand Down Expand Up @@ -248,15 +258,12 @@ public void extractConfigurationStandalone(Node targetNode, Writer writer,
List<SelectFromTableEvent> initialLoadEvents = new ArrayList<SelectFromTableEvent>(
triggerRouters.size() * 2);

boolean pre37 = Version.isOlderThanVersion(targetNode.getSymmetricVersion(), "3.7.0");
boolean pre38 = Version.isOlderThanVersion(targetNode.getSymmetricVersion(), "3.8.0");

for (int i = triggerRouters.size() - 1; i >= 0; i--) {
TriggerRouter triggerRouter = triggerRouters.get(i);
String channelId = triggerRouter.getTrigger().getChannelId();
if (Constants.CHANNEL_CONFIG.equals(channelId)
|| Constants.CHANNEL_HEARTBEAT.equals(channelId)) {
if (filter(pre37, pre38, triggerRouter.getTrigger().getSourceTableName())) {
if (filter(targetNode, triggerRouter.getTrigger().getSourceTableName())) {

TriggerHistory triggerHistory = triggerRouterService
.getNewestTriggerHistoryForTrigger(triggerRouter.getTrigger()
Expand Down Expand Up @@ -296,8 +303,7 @@ public void extractConfigurationStandalone(Node targetNode, Writer writer,
String channelId = triggerRouter.getTrigger().getChannelId();
if (Constants.CHANNEL_CONFIG.equals(channelId)
|| Constants.CHANNEL_HEARTBEAT.equals(channelId)) {
if (!(pre37 && triggerRouter.getTrigger().getSourceTableName().toLowerCase()
.contains("extension"))) {
if (filter(targetNode, triggerRouter.getTrigger().getSourceTableName())) {
TriggerHistory triggerHistory = triggerRouterService
.getNewestTriggerHistoryForTrigger(triggerRouter.getTrigger()
.getTriggerId(), null, null, null);
Expand Down

0 comments on commit 0c6d31c

Please sign in to comment.