[ 
https://issues.apache.org/jira/browse/CASSANDRA-20074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17898568#comment-17898568
 ] 

Stefan Miklosovic commented on CASSANDRA-20074:
-----------------------------------------------

Trunk is a little bit hairy but nothing completely out of ordinary / issues are 
not related. PstmtPersistenceTest is being worked on.

[CASSANDRA-20074-trunk|https://github.com/instaclustr/cassandra/tree/CASSANDRA-20074-trunk]
{noformat}
java11_pre-commit_tests                         
  ✓ j11_build                                        8m 54s
  ✓ j11_cqlsh_dtests_py311                            7m 9s
  ✓ j11_cqlsh_dtests_py311_vnode                      8m 6s
  ✓ j11_cqlsh_dtests_py38                            7m 14s
  ✓ j11_cqlsh_dtests_py38_vnode                      8m 10s
  ✓ j11_cqlshlib_cython_tests                       12m 16s
  ✓ j11_cqlshlib_tests                               6m 49s
  ✓ j11_dtests                                      36m 47s
  ✓ j11_dtests_latest                               38m 19s
  ✓ j11_simulator_dtests                              9m 9s
  ✓ j11_unit_tests                                   17m 5s
  ✓ j11_utests_latest                               15m 28s
  ✓ j11_utests_oa                                   18m 17s
  ✓ j11_utests_system_keyspace_directory            15m 32s
  ✓ j17_cqlsh_dtests_py311                           7m 11s
  ✓ j17_cqlsh_dtests_py311_vnode                     8m 57s
  ✓ j17_cqlsh_dtests_py38                            6m 59s
  ✓ j17_cqlsh_dtests_py38_vnode                      7m 22s
  ✓ j17_cqlshlib_cython_tests                        11m 1s
  ✓ j17_cqlshlib_tests                               6m 55s
  ✓ j17_dtests                                      32m 33s
  ✓ j17_dtests_latest                               35m 31s
  ✓ j17_dtests_vnode                                34m 12s
  ✕ j11_dtests_vnode                                39m 26s
  ✕ j11_jvm_dtests                                  37m 28s
      
org.apache.cassandra.distributed.test.guardrails.GuardrailItemsPerCollectionOnSSTableWriteTest
 testListSizeAfterCompaction
      
org.apache.cassandra.distributed.test.guardrails.GuardrailItemsPerCollectionOnSSTableWriteTest
 testSetSize
      org.apache.cassandra.distributed.test.TransientRangeMovement2Test 
testMoveBackward TIMEOUTED
  ✕ j11_jvm_dtests_latest_vnode                     23m 51s
      org.apache.cassandra.distributed.test.tcm.CMSPlacementAfterMoveTest 
testMoveToCMS
  ✕ j17_jvm_dtests                                  24m 33s
      org.apache.cassandra.distributed.test.ReadSpeculationTest speculateTest
  ✕ j17_jvm_dtests_latest_vnode                     23m 25s
      org.apache.cassandra.distributed.test.tcm.CMSPlacementAfterMoveTest 
testMoveToCMS
  ✕ j17_unit_tests                                   15m 3s
      org.apache.cassandra.cql3.PstmtPersistenceTest testPstmtInvalidation
  ✕ j17_utests_latest                               13m 30s
      org.apache.cassandra.cql3.PstmtPersistenceTest testPstmtInvalidation
  ✕ j17_utests_oa                                   14m 52s
      org.apache.cassandra.cql3.PstmtPersistenceTest testPstmtInvalidation
java11_separate_tests                            
{noformat}

[java11_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/4999/workflows/c6891c04-6589-4fdf-a661-8206bcd84a19]



> AbstractCommitLogService#lastSyncedAt initialized with currentTimeMillis() 
> but later compared and updated with System.nanoTime() 
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-20074
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20074
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Commit Log
>            Reporter: Dmitry Konstantinov
>            Assignee: Dmitry Konstantinov
>            Priority: Low
>             Fix For: 4.0.x, 4.1.x, 5.0.x, 5.x
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Within org.apache.cassandra.db.commitlog.AbstractCommitLogService
> we use System.currentMillis()-based time to initialize lastSyncedAt field:
> {code:java}
> protected volatile long lastSyncedAt = currentTimeMillis();{code}
> but later we use clock.now() = System.nanoTime() to compare and update the 
> field value:
> {code:java}
> long pollStarted = clock.now();
> boolean flushToDisk = lastSyncedAt + syncIntervalNanos <= pollStarted || 
> state != NORMAL || syncRequested; {code}
> As of now we are lucky that in the current JDK implementations 
> System.nanoTime() is much bigger than currentTimeMillis() but it is not 
> guaranteed by a specification of the API. If  nanoTime() < 
> currentTimeMillis() then we can stuck without sync of commit log to disk.
> So, we need to align the time sources and change the init logic to:
> {code:java}
> protected volatile long lastSyncedAt = preciseTime.now();{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to