Hi Bathyar,

I have analyzed the provided logs and the output of *HGETALL *command*. *By
looking at the *HGETALL* output, it seems like you have updated the
record's primary key field as well. In siddhi store Redis implementation we
cannot update the primary keys since when we mapping the relational values
to Redis, we use primary key as a main pillar of the mapping. So, when you
update the primary key, functionalities will break afterword. So could you
please check your implementation and make sure you are not updating the
primary key after creating a record.
If you can provide the complete siddhi app and a sample data set(csv
perhaps), we can simulate the scenario in our and provide you with a
solution.

Thank You,
Anusha.

On Mon, Nov 26, 2018 at 12:17 AM Bahtiyar KARANLIK <[email protected]>
wrote:

> And these are the items from Redis;
>
> *127.0.0.1:6379 <http://127.0.0.1:6379>> HGETALL
> pm_threshold_bk_temp:threshold_rule_103*
>  1) "is_active"
>  2) "false"
>  3) "threshold_updated_at"
>  4) "2018-11-20 17:51:55.001599+03"
>  5) "path_regex"
>  6) ".*NT3.*.TCPConnectionCreateAttemptsInboundCurrentVal"
>  7) "threshold_id"
>  8) "threshold_rule_79"
>  9) "cache_time"
> 10) "1543170218704"
> 11) "threshold_context"
> 12) "{selectivity=0, is_active=false, critical=100.0, task_step_id=0,
> warning_action=6, created_at=2018-09-13 16:30:22.953007+03,
> aggr_field=value, aggr_function=current, critical_action=6,
> metric_name=null, updated_at=2018-11-20 17:51:55.001599+03, warning=80.0,
> id=79, path_regex=.*NT3.*.TCPConnectionCreateAttemptsInboundCurrentVal}"
> *127.0.0.1:6379 <http://127.0.0.1:6379>> hgetall
> pm_threshold_bk_temp:threshold_rule_37*
>  1) "is_active"
>  2) "false"
>  3) "threshold_updated_at"
>  4) "2018-11-20 17:51:55.001599+03"
>  5) "path_regex"
>  6) ".*NT3.*.TCPConnectionCreateAttemptsInboundCurrentVal"
>  7) "threshold_id"
>  8) "threshold_rule_79"
>  9) "cache_time"
> 10) "1543170218704"
> 11) "threshold_context"
> 12) "{selectivity=0, is_active=false, critical=100.0, task_step_id=0,
> warning_action=6, created_at=2018-09-13 16:30:22.953007+03,
> aggr_field=value, aggr_function=current, critical_action=6,
> metric_name=null, updated_at=2018-11-20 17:51:55.001599+03, warning=80.0,
> id=79, path_regex=.*NT3.*.TCPConnectionCreateAttemptsInboundCurrentVal}"
>
>
>
> On Sun, Nov 25, 2018 at 9:32 PM Bahtiyar KARANLIK <[email protected]>
> wrote:
>
>> Hi Anushaj,
>>
>> I've attached the log file. Since it is too big, I'm sending it to you
>> only.
>>
>> Best regards,
>>
>> bahtiyar.
>>
>>
>> On Sat, Nov 24, 2018 at 5:23 PM Anusha Jayasundara <[email protected]>
>> wrote:
>>
>>> Hi Bathiyar,
>>>
>>> We followed up the above scenario and we could not observe any issues
>>> related to Redis "update of insert" process. In Redis implementation, if
>>> the given command is "update or insert", we will create a HashSet according
>>> to our mapping in Redis side, if it exists, the old one will get updated
>>> with the new values.
>>> In order to exactly identify the issue could you please share the log
>>> output of the "ThresholdTableStream " stream from above execution plan.
>>>
>>>
>>> Thank You,
>>> Anusha
>>>
>>> On Sat, Nov 24, 2018 at 7:30 PM Mohanadarshan Vivekanandalingam <
>>> [email protected]> wrote:
>>>
>>>> Hi Anusha,
>>>>
>>>> Can you please followup and respond to this..
>>>>
>>>> Thanks,
>>>> Mohan
>>>>
>>>>
>>>> On Tue, Nov 20, 2018 at 3:57 PM Bahtiyar KARANLIK <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> I'm trying to retrieve the records in a PostgreSQL table and update or
>>>>> insert them into Redis. Below code creates all KEYS in the Redis instance,
>>>>> BUT all items contain the very same record (of Threshold rule) (hgetall
>>>>> keyname1 and hgetall keyname2 returns the same result)
>>>>>
>>>>> I'm not sure if this is a bug or a feature, and stuck here.. Any
>>>>> advices are highly appreciated..
>>>>>
>>>>> best regards,
>>>>>
>>>>> define trigger ConfigReloadTrigger at every 60 sec;
>>>>>
>>>>> @Store(type = "rdbms", jdbc.url = "jdbc:postgresql://localhost/my_db", 
>>>>> username = "my_user", password = "my_pwd" , jdbc.driver.name = 
>>>>> "org.postgresql.Driver", table.name = 'pm_threshold')
>>>>> @Index('metric_name')
>>>>> @primaryKey('id')
>>>>> define table ThresholdTable(id int, created_at string, updated_at string, 
>>>>> path_regex string, aggr_field string, aggr_function string, warning 
>>>>> double, warning_action int, critical double, critical_action int, 
>>>>> is_active bool, task_step_id int, metric_name string, selectivity int);
>>>>>
>>>>> @Store(type='redis', table.name='pm_threshold', nodes='localhost:6373', 
>>>>> cluster.mode='false')
>>>>> @primaryKey('threshold_id')
>>>>> define table ThresholdCache(threshold_id string, is_active bool, 
>>>>> path_regex string, threshold_updated_at string, threshold_context object, 
>>>>> cache_time long);
>>>>>
>>>>> from ConfigReloadTrigger join ThresholdTable
>>>>> select
>>>>>     str:concat('threshold_rule_', ThresholdTable.id 
>>>>> <http://thresholdtable.id/>) as threshold_id,
>>>>>     ThresholdTable.is_active,
>>>>>     ThresholdTable.path_regex,
>>>>>     ThresholdTable.updated_at as threshold_updated_at,
>>>>>     map:create(
>>>>>         "id", ThresholdTable.id <http://thresholdtable.id/>,
>>>>>         "metric_name", ThresholdTable.metric_name,
>>>>>         "path_regex", ThresholdTable.path_regex,
>>>>>         "selectivity", ThresholdTable.selectivity,
>>>>>         "aggr_field", ThresholdTable.aggr_field,
>>>>>         "aggr_function", ThresholdTable.aggr_function,
>>>>>         "warning", ThresholdTable.warning,
>>>>>         "warning_action", ThresholdTable.warning_action,
>>>>>         "critical", ThresholdTable.critical,
>>>>>         "critical_action", ThresholdTable.critical_action,
>>>>>         "is_active", ThresholdTable.is_active,
>>>>>         "task_step_id", ThresholdTable.task_step_id,
>>>>>         "created_at", ThresholdTable.created_at,
>>>>>         "updated_at", ThresholdTable.updated_at
>>>>>     ) as threshold_context,
>>>>>     eventTimestamp() as cache_time
>>>>> insert into ThresholdTableStream;
>>>>>
>>>>> from ThresholdTableStream#log(true)
>>>>> select
>>>>>     ThresholdTableStream.threshold_id,
>>>>>     ThresholdTableStream.is_active,
>>>>>     ThresholdTableStream.path_regex,
>>>>>     ThresholdTableStream.threshold_updated_at,
>>>>>     ThresholdTableStream.threshold_context,
>>>>>     ThresholdTableStream.cache_time
>>>>> update or insert into ThresholdCache
>>>>>     set
>>>>>     ThresholdCache.threshold_id = threshold_id,
>>>>>     ThresholdCache.is_active = is_active,
>>>>>     ThresholdCache.path_regex = path_regex,
>>>>>     ThresholdCache.threshold_updated_at = threshold_updated_at,
>>>>>     ThresholdCache.threshold_context = threshold_context,
>>>>>     ThresholdCache.cache_time = cache_time
>>>>>     on ThresholdCache.threshold_id == threshold_id;
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>
>>>>
>>>> --
>>>> *V. Mohanadarshan* | Technical Lead | WSO2 Inc. <http://www.wso2.com/>
>>>>  |
>>>> (M) 94-771117673 | (E) [email protected] |
>>>> GET INTEGRATION AGILE
>>>> Integration Agility for Digitally Driven Business
>>>>
>>>
>>>
>>> --
>>>
>>> *Anusha Jayasundara*
>>> Software Engineer | WSO2
>>>
>>> Email : [email protected]
>>> Mobile : +94772601160
>>> Web : http://wso2.com
>>> Lean.Enterprise.Middleware
>>> <http://wso2.com/signature>
>>>
>>

-- 

*Anusha Jayasundara*
Software Engineer | WSO2

Email : [email protected]
Mobile : +94772601160
Web : http://wso2.com
Lean.Enterprise.Middleware
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to