Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1017

Calendar possible race condition, cause wrong timestamp setting

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.8
    • 3.0.9
    • Other
    • None

    Description

      For instance, given the following data:

      Id Event_Date_Time
      0 2022-09-01T00:00:00Z
      1 2022-09-01T01:00:00Z
      2 2022-09-01T02:00:00Z
      3 2022-09-01T03:00:00Z
      4 2022-09-01T04:00:00Z
      5 2022-09-02T00:00:00Z
      6 2022-09-02T01:00:00Z
      7 2022-09-02T02:00:00Z
      8 2022-09-02T03:00:00Z
      9 2022-09-02T04:00:00Z

      If I insert these rows with 2 threads in parallel (one thread bulk inserting the 5 first rows and another thread bulk inserting the 5 last rows), when I select the inserted rows, the values are randomly scrambled, for instance:

      Id Event_Date_Time
      0 2022-09-01T00:00:00Z
      1 2022-09-02T01:00:00Z
      2 2022-09-02T03:00:00Z
      3 2022-09-02T04:00:00Z
      4 2022-09-01T04:00:00Z
      5 2022-09-01T00:00:00Z
      6 2022-09-02T01:00:00Z
      7 2022-09-02T02:00:00Z
      8 2022-09-02T03:00:00Z
      9 2022-09-02T04:00:00Z

      If I insert these rows in bulk without concurrence, there's no issue.

      Demo : https://github.com/romainmoreau/mariadb-demo

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            romainmoreau Romain Moreau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.