Skip to content
Closed
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
4 changes: 2 additions & 2 deletions lib/src/sai_redis_interfacequery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ sai_status_t sai_api_initialize(

memcpy(&g_services, services, sizeof(g_services));

g_db = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
g_dbNtf = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
g_db = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::SECONDARY_UNIXSOCKET, 0);
g_dbNtf = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::SECONDARY_UNIXSOCKET, 0);
g_asicState = std::make_shared<swss::ProducerTable>(g_db.get(), ASIC_STATE_TABLE);
g_redisGetConsumer = std::make_shared<swss::ConsumerTable>(g_db.get(), "GETRESPONSE");
g_redisNotifications = std::make_shared<swss::NotificationConsumer>(g_dbNtf.get(), "NOTIFICATIONS");
Expand Down
2 changes: 1 addition & 1 deletion saidump/saidump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int main(int argc, char ** argv)

g_cmdOptions = handleCmdLine(argc, argv);

swss::DBConnector db(ASIC_DB, DBConnector::DEFAULT_UNIXSOCKET, 0);
swss::DBConnector db(ASIC_DB, DBConnector::SECONDARY_UNIXSOCKET, 0);

std::string table = ASIC_STATE_TABLE;

Expand Down
4 changes: 4 additions & 0 deletions syncd/scripts/syncd_init_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ config_syncd_cavium()
sleep 1
done

until [ $(redis-cli -p 6380 ping | grep -c PONG) -gt 0 ]; do
sleep 1
done

if [ $FAST_REBOOT == "yes" ]; then
CMD_ARGS+=" -t fast"
fi
Expand Down
4 changes: 2 additions & 2 deletions syncd/syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3437,8 +3437,8 @@ int syncd_main(int argc, char **argv)
}
#endif // SAITHRIFT

std::shared_ptr<swss::DBConnector> dbAsic = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
std::shared_ptr<swss::DBConnector> dbNtf = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
std::shared_ptr<swss::DBConnector> dbAsic = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::SECONDARY_UNIXSOCKET, 0);
std::shared_ptr<swss::DBConnector> dbNtf = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::SECONDARY_UNIXSOCKET, 0);
std::shared_ptr<swss::DBConnector> dbFlexCounter = std::make_shared<swss::DBConnector>(FLEX_COUNTER_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);

g_redisClient = std::make_shared<swss::RedisClient>(dbAsic.get());
Expand Down
2 changes: 1 addition & 1 deletion syncd/syncd_applyview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ void redisGetAsicView(

SWSS_LOG_TIMER("get asic view from %s", tableName.c_str());

swss::DBConnector db(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
swss::DBConnector db(ASIC_DB, swss::DBConnector::SECONDARY_UNIXSOCKET, 0);

swss::Table table(&db, tableName);

Expand Down
2 changes: 1 addition & 1 deletion syncd/syncd_request_shutdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}

swss::DBConnector db(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
swss::DBConnector db(ASIC_DB, swss::DBConnector::SECONDARY_UNIXSOCKET, 0);
swss::NotificationProducer restartQuery(&db, "RESTARTQUERY");

std::vector<swss::FieldValueTuple> values;
Expand Down
4 changes: 2 additions & 2 deletions syncd/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void clearDB()
{
SWSS_LOG_ENTER();

swss::DBConnector db(ASIC_DB, "localhost", 6379, 0);
swss::DBConnector db(ASIC_DB, "localhost", 6380, 0);
swss::RedisReply r(&db, "FLUSHALL", REDIS_REPLY_STATUS);
r.checkStatusOK();
}
Expand Down Expand Up @@ -152,7 +152,7 @@ void bulk_nhgm_consumer_worker()
SWSS_LOG_ENTER();

std::string tableName = ASIC_STATE_TABLE;
swss::DBConnector db(ASIC_DB, "localhost", 6379, 0);
swss::DBConnector db(ASIC_DB, "localhost", 6380, 0);
swss::ConsumerTable c(&db, tableName);
swss::Select cs;
swss::Selectable *selectcs;
Expand Down
12 changes: 12 additions & 0 deletions tests/utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ sub flush_redis
print color('red') . "failed to flush redis: @ret" . color('reset') . "\n";
exit 1;
}

my @ret_sec = `redis-cli -p 6380 flushall`;

$ret_sec[0] = "failed" if not defined $ret_sec[0];

chomp $ret_sec[0];

if ($ret_sec[0] ne "OK")
{
print color('red') . "failed to flush redis port 6380: @ret" . color('reset') . "\n";
exit 1;
}
}

sub start_syncd
Expand Down
2 changes: 1 addition & 1 deletion vslib/src/sai_vs_interfacequery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ sai_status_t sai_api_initialize(

clear_local_state();

g_dbNtf = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::DEFAULT_UNIXSOCKET, 0);
g_dbNtf = std::make_shared<swss::DBConnector>(ASIC_DB, swss::DBConnector::SECONDARY_UNIXSOCKET, 0);
g_unittestChannelNotificationConsumer = std::make_shared<swss::NotificationConsumer>(g_dbNtf.get(), SAI_VS_UNITTEST_CHANNEL);

g_unittestChannelRun = true;
Expand Down
2 changes: 1 addition & 1 deletion vslib/src/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void test_set_readonly_attribute_via_redis()

// this scope contains all operations needed to perform set operation on readonly attribute
{
swss::DBConnector db(ASIC_DB, "localhost", 6379, 0);
swss::DBConnector db(ASIC_DB, "localhost", 6380, 0);
swss::NotificationProducer vsntf(&db, SAI_VS_UNITTEST_CHANNEL);

std::vector<swss::FieldValueTuple> entry;
Expand Down