[ 
https://issues.apache.org/jira/browse/ARTEMIS-3763?focusedWorklogId=756220&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-756220
 ]

ASF GitHub Bot logged work on ARTEMIS-3763:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Apr/22 07:48
            Start Date: 13/Apr/22 07:48
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on PR #4017:
URL: 
https://github.com/apache/activemq-artemis/pull/4017#issuecomment-1097669161

   hi @MM53 
   this looks similar to `maxAllowableDiffFromDBTime` in Classic ActiveMQ (see 
https://activemq.apache.org/pluggable-storage-lockers for more info): I agree 
that it could be useful, but dangerous as well, because if the difference 
specified exceed few milliseconds it can mask other problems (ie distance 
between broker and DBMS, lack of CPU time on both, misaligned clocks etc etc) 
that would prevent the feature to work as expected, anyway.
   
   > But the query causing the problem ("SELECT CURRENT_TIMESTAMP FROM ...") 
was not changed
   
   you should check the query that's actually used by your driver; I don't 
remember by heart if it's the right one TBH.
   
   In short, in order to have aligned clocks, the machines need to use NTP or 
other (better) mechanisms to be sure that broker <-> BDMS time is correctly 
aligned.
   JDBC is not meant to be used with machines too distant




Issue Time Tracking
-------------------

    Worklog Id:     (was: 756220)
    Time Spent: 1h  (was: 50m)

> Use configurable time margin for checking offset between database server and 
> broker
> -----------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3763
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3763
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 2.21.0
>            Reporter: Marlon Müller
>            Priority: Minor
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> When using JDBC persistence artemis checks for time differences between the 
> broker and the database. Currently this check requests the time of the 
> database and compares it to the system time before and after sending this 
> query by removing the milliseconds and verifying that the database time is 
> between the start and the end time. 
> This leads to somehow random warnings in the log depending on the current 
> milliseconds when this check is performed. 
> For example if the time on your artemis server is 00:00:01.000 before the 
> check and the time on the database is 00:00:00.999 it will log a warning 
> although there is only 1 millisecond difference. On the other hand if your 
> artemis server time is 00:00:01.000 after sending the query and the database 
> time is 00:00:01.999 there will be no warning although the time is 999 
> milliseconds after the end time.
> Therefore it would be better to use a consistent margin for the database time 
> during this check. To avoid problems in setups where the system times are not 
> well synchronized, this time margin should be configurable to allow the user 
> to fine tune it.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to