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

Update feature/perf again #6173

Merged
merged 15 commits into from
Dec 12, 2024
Merged

Update feature/perf again #6173

merged 15 commits into from
Dec 12, 2024

Conversation

edwintorok
Copy link
Contributor

Can't solve the conflicts on feature/perf due to branch restrictions, have to open PR from another branch.

freddy77 and others added 15 commits December 6, 2024 15:41
Test that the event is correctly executed.

Signed-off-by: Frediano Ziglio <[email protected]>
Do not use ">" or other operators to compare Mtime.t, the value is intended to
be unsigned and should be compared with Int64.unsigned_compare as Mtime
functions do.

Signed-off-by: Frediano Ziglio <[email protected]>
The parameter was false only to support an internal usage, external users
should always alert the thread loop.

Signed-off-by: Frediano Ziglio <[email protected]>
- Do not wait huge amount of time if the queue is empty but
  use Delay.wait if possible;
- Fix delete of periodic events. In case the event is processed
  it's removed from the queue. Previously remove_from_queue was
  not able to mark this event as removed;
- Do not race between checking the first event and removing it.
  These 2 actions were done in 2 separate critical section, now
  they are done in a single one.

Signed-off-by: Frediano Ziglio <[email protected]>
Potentially a periodic event can be cancelled while this is processed.
Simulate this behavior removing the event inside the handler.
This was fixed by previous commit.

Signed-off-by: Frediano Ziglio <[email protected]>
Previously if the queue was empty and the loop thread was active
the scheduler took quite some time to pick up the new event.
Check that this is done in a timely fashion to avoid regressions in code.

Signed-off-by: Frediano Ziglio <[email protected]>
Similar to test_empty test however the state of the loop should be different.

Signed-off-by: Frediano Ziglio <[email protected]>
For the scan retry, previously we were comparing the entire vdi data
structure from the database using the (<>) operator. This is a bit
wasteful and not very stable. Instead let us just compare the vdi refs,
since the race here comes from `VDI.db_{introduce,forget}`, which would
only add/remove vdis from the db, but not change its actual data
structure.

Also add a bit more logging when retrying, since this should not happen
very often.

Signed-off-by: Vincent Liu <[email protected]>
When add leaked datapath:
1. add leaked datapath to Sr.vdis
2. write to db file
3. log enhance

If there are storage exceptions raised when destroying datapath,
the procedure fails and the state of VDI becomes incorrect,
which leads to various abnormalresults in subsequent operations.
To handle this, the leaked datapath is designed to redestroy the
datapath and refresh the state before next storage operation via
function remove_datapaths_andthen_nolock. But this mechanism
doesn't take effect in current code.
This commit is to fix this bug. Leaked datapath should be added
to Sr.vdis to make the leaked datapath really work. And write to
db file to avoid losing the leaked datapath if xapi restarts.

Signed-off-by: Changlei Li <[email protected]>
There was some issue in the current code, from structure corruption to
thread safety.
Add some test and fix discovered issues.

More details on commit messages.
When add leaked datapath:
1. add leaked datapath to Sr.vdis
2. write to db file
3. log enhance

If there are storage exceptions raised when destroying datapath,
the procedure fails and the state of VDI becomes incorrect,
which leads to various abnormalresults in subsequent operations.
To handle this, the leaked datapath is designed to redestroy the
datapath and refresh the state before next storage operation via
function remove_datapaths_andthen_nolock. But this mechanism
doesn't take effect in current code.
This commit is to fix this bug. leaked datapath should be added
to Sr.vdis to make the leaked datapath really work. And write to
db file to avoid losing the leaked datapath if xapi restarts.
For the scan retry, previously we were comparing the entire vdi data
structure from the database using the (<>) operator. This is a bit
wasteful and not very stable. Instead let us just compare the vdi refs,
since the race here comes from `VDI.db_{introduce,forget}`, which would
only add/remove vdis from the db, but not change its actual data
structure.

Also add a bit more logging when retrying, since this should not happen
very often.
Signed-off-by: Edwin Török <[email protected]>
@edwintorok edwintorok merged commit 0b34302 into feature/perf Dec 12, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants