Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mutex to listinfInfo #30131

Merged
merged 6 commits into from
Feb 8, 2022
Merged

add mutex to listinfInfo #30131

merged 6 commits into from
Feb 8, 2022

Conversation

aspacca
Copy link

@aspacca aspacca commented Feb 1, 2022

Bug

What does this PR do?

Add a mutex to listingInfo used by states in the s3 poller filebeat input

Why is it important?

see #30123

Checklist

  • My code follows the style guidelines of this project
    - [ ] I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Closes #30123

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 1, 2022
@aspacca aspacca requested a review from efd6 February 1, 2022 10:29
@aspacca aspacca self-assigned this Feb 1, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 1, 2022

This pull request does not have a backport label. Could you fix it @aspacca? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Feb 1, 2022
@aspacca aspacca added Team:Integrations Label for the Integrations team and removed backport-skip Skip notification from the automated backport with mergify labels Feb 1, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 1, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 1, 2022

This pull request does not have a backport label. Could you fix it @aspacca? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Feb 1, 2022
@aspacca aspacca added the backport-v8.0.0 Automated backport with mergify label Feb 1, 2022
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Feb 1, 2022
Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative to locking that might want to be considered is to use atomic. That adds complexity though.

@aspacca
Copy link
Author

aspacca commented Feb 1, 2022

I switched to atomic approach as suggested

ATOMIC
=== RUN   TestBenchmarkInputS3
+-------------------+------------------------+---------------------------+-----------------------+--------------------+------------------+--------------------+------+
| NUMBER OF WORKERS | OBJECTS LISTED PER SEC | OBJECTS PROCESSED PER SEC | OBJECTS ACKED PER SEC |   EVENTS PER SEC   | S3 BYTES PER SEC |     TIME (SEC)     | CPUS |
+-------------------+------------------------+---------------------------+-----------------------+--------------------+------------------+--------------------+------+
|                 1 |     1434.2050811976815 |         717.1025405988407 |     717.1025405988407 |  45177.46005772697 | 1.5 MB           |       13.945007072 |   16 |
|                 2 |     2595.0607781581325 |        1297.5303890790663 |    1297.5303890790663 |  81744.41451198117 | 2.8 MB           |        7.706948588 |   16 |
|                 4 |      4071.126715920752 |         2035.563357960376 |     2035.563357960376 | 128240.49155150368 | 4.4 MB           |        4.912644925 |   16 |
|                 8 |        5909.7197565948 |           2954.8598782974 |       2954.8598782974 |  186156.1723327362 | 6.4 MB           |        3.384255231 |   16 |
|                16 |      7049.456983923751 |        3524.7284919618755 |    3524.7284919618755 | 222057.89499359817 | 7.6 MB           |        2.837097956 |   16 |
|                32 |     7540.0733816303455 |        3770.0366908151727 |    3770.0366908151727 | 237512.31152135588 | 8.1 MB           | 2.6524940790000002 |   16 |
|                64 |      7427.224447093106 |         3713.612223546553 |     3713.612223546553 | 233957.57008343286 | 8.0 MB           |        2.692795962 |   16 |
|               128 |      7791.060677918444 |         3895.530338959222 |     3895.530338959222 | 245418.41135443098 | 8.4 MB           |        2.567044569 |   16 |
|               256 |      8919.684197689012 |         4459.842098844506 |     4459.842098844506 |  280970.0522272039 | 9.6 MB           |         2.24223185 |   16 |
|               512 |      8475.858190865829 |         4237.929095432914 |     4237.929095432914 |  266989.5330122736 | 9.2 MB           |        2.359643065 |   16 |
|              1024 |      9167.382995660642 |         4583.691497830321 |     4583.691497830321 | 288772.56436331023 | 9.9 MB           |        2.181647697 |   16 |
+-------------------+------------------------+---------------------------+-----------------------+--------------------+------------------+--------------------+------+
--- PASS: TestBenchmarkInputS3 (47.56s)

MUTEX
=== RUN   TestBenchmarkInputS3
+-------------------+------------------------+---------------------------+-----------------------+--------------------+------------------+--------------------+------+
| NUMBER OF WORKERS | OBJECTS LISTED PER SEC | OBJECTS PROCESSED PER SEC | OBJECTS ACKED PER SEC |   EVENTS PER SEC   | S3 BYTES PER SEC |     TIME (SEC)     | CPUS |
+-------------------+------------------------+---------------------------+-----------------------+--------------------+------------------+--------------------+------+
|                 1 |     1504.0947425259376 |         752.0473712629688 |     752.0473712629688 | 47378.984389567035 | 1.6 MB           |       13.297034711 |   16 |
|                 2 |     2637.3115034283223 |        1318.6557517141612 |    1318.6557517141612 |  83075.31235799215 | 2.8 MB           |        7.583480364 |   16 |
|                 4 |      4076.316465046439 |        2038.1582325232196 |    2038.1582325232196 | 128403.96864896284 | 4.4 MB           |        4.906390407 |   16 |
|                 8 |      6595.825217280334 |         3297.912608640167 |     3297.912608640167 |  207768.4943443305 | 7.1 MB           |         3.03222104 |   16 |
|                16 |      7162.439559574715 |        3581.2197797873573 |    3581.2197797873573 | 225616.84612660352 | 7.7 MB           | 2.7923446800000002 |   16 |
|                32 |      7551.593417908992 |         3775.796708954496 |     3775.796708954496 | 237875.19266413324 | 8.2 MB           |        2.648447671 |   16 |
|                64 |      7463.453381301695 |        3731.7266906508476 |    3731.7266906508476 | 235098.78151100338 | 8.1 MB           |         2.67972465 |   16 |
|               128 |      8069.531857188773 |        4034.7659285943864 |    4034.7659285943864 | 254190.25350144634 | 8.7 MB           |        2.478458522 |   16 |
|               256 |      8408.853569581128 |         4204.426784790564 |     4204.426784790564 | 264878.88744180556 | 9.1 MB           |        2.378445508 |   16 |
|               512 |      8168.044955981746 |         4084.022477990873 |     4084.022477990873 | 257293.41611342502 | 8.8 MB           |        2.448566347 |   16 |
|              1024 |      8686.748007933013 |         4343.374003966506 |     4343.374003966506 |  273632.5622498899 | 9.4 MB           |        2.302357566 |   16 |
+-------------------+------------------------+---------------------------+-----------------------+--------------------+------------------+--------------------+------+
--- PASS: TestBenchmarkInputS3 (46.63s)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 1, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Reason: null

  • Start Time: 2022-02-04T09:27:55.791+0000

  • Duration: 128 min 29 sec

  • Commit: eea234a

Test stats 🧪

Test Results
Failed 0
Passed 4463
Skipped 314
Total 4777

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but the I think the inequality used for updating listingInfo.finalCheck should be more careful (already existing code).

@matschaffer matschaffer removed their request for review February 3, 2022 01:35
@aspacca aspacca added the backport-v8.1.0 Automated backport with mergify label Feb 4, 2022
@aspacca aspacca removed the backport-v8.0.0 Automated backport with mergify label Feb 7, 2022
@aspacca aspacca merged commit ce2e5c2 into elastic:main Feb 8, 2022
mergify bot pushed a commit that referenced this pull request Feb 8, 2022
* add mutex to listinfInfo

* back to mutex

* add warn logging for totObject not matchig sum of storedObjects and errorObjects in listingInfo

* changelog

* fix merge

(cherry picked from commit ce2e5c2)
aspacca pushed a commit that referenced this pull request Feb 9, 2022
* add mutex to listinfInfo (#30131)

* add mutex to listinfInfo

* back to mutex

* add warn logging for totObject not matchig sum of storedObjects and errorObjects in listingInfo

* changelog

* fix merge

(cherry picked from commit ce2e5c2)

* clean changelog

Co-authored-by: Andrea Spacca <andrea.spacca@elastic.co>
@aspacca aspacca added backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.0.0 Automated backport with mergify labels Feb 11, 2022
mergify bot pushed a commit that referenced this pull request Feb 11, 2022
* add mutex to listinfInfo

* back to mutex

* add warn logging for totObject not matchig sum of storedObjects and errorObjects in listingInfo

* changelog

* fix merge

(cherry picked from commit ce2e5c2)
mergify bot pushed a commit that referenced this pull request Feb 11, 2022
* add mutex to listinfInfo

* back to mutex

* add warn logging for totObject not matchig sum of storedObjects and errorObjects in listingInfo

* changelog

* fix merge

(cherry picked from commit ce2e5c2)
aspacca pushed a commit that referenced this pull request Feb 12, 2022
* add mutex to listinfInfo

* back to mutex

* add warn logging for totObject not matchig sum of storedObjects and errorObjects in listingInfo

* changelog

* fix merge

(cherry picked from commit ce2e5c2)

Co-authored-by: Andrea Spacca <andrea.spacca@elastic.co>
aspacca pushed a commit that referenced this pull request Feb 14, 2022
* add mutex to listinfInfo (#30131)

* add mutex to listinfInfo

* back to mutex

* add warn logging for totObject not matchig sum of storedObjects and errorObjects in listingInfo

* changelog

* fix merge

(cherry picked from commit ce2e5c2)

* fix changelog

Co-authored-by: Andrea Spacca <andrea.spacca@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.0.0 Automated backport with mergify backport-v8.1.0 Automated backport with mergify Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing test: x-pack/filebeat/input/awss3 TestBenchmarkInputS3
4 participants