Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cpjulia
Copy link
Contributor

@cpjulia cpjulia commented Oct 10, 2025

Scope & Purpose

(Please describe the changes in this PR for reviewers, motivation, rationale - mandatory)

  • πŸ’© Bugfix
  • πŸ• New feature
  • πŸ”₯ Performance improvement
  • πŸ”¨ Refactoring/simplification

Checklist

  • Tests
    • Regression tests
    • C++ Unit tests
    • integration tests
    • resilience tests
  • πŸ“– CHANGELOG entry made
  • πŸ“š documentation written (release notes, API changes, ...)
  • Backports
    • Backport for 3.12.0: (Please link PR)
    • Backport for 3.11: (Please link PR)
    • Backport for 3.10: (Please link PR)

Related Information

(Please reference tickets / specification / other PRs etc)

  • Docs PR:
  • Enterprise PR:
  • GitHub issue / Jira ticket:
  • Design document:

Note

Introduce a new AqlValue kind that stores VPack with ResourceMonitor accounting, extend constructors/ops to use it, and add comprehensive unit tests.

  • AQL/Core:
    • Add new AqlValueType VPACK_SUPERVISED_SLICE with ResourceMonitor-aware allocation, cloning, and destruction.
    • Extend constructors (string_view, Buffer, Slice, DocumentData, AqlValueHintSliceCopy) to accept optional ResourceMonitor* and create supervised slices.
    • Update value predicates (is*), slice(), getTypeString(), length(), toVelocyPack(), destroy(), memoryUsage(), and requiresDestruction() to handle supervised slices.
    • Modify accessors (at(), get(), getKeyAttribute(), getIdAttribute(), getFromAttribute(), getToAttribute(), hasKey()) to optionally copy under supervision and return slice-pointers when not copying.
    • Implement helpers setSupervisedData(), allocateSupervised(), deallocateSupervised(); adjust data() to return payload; support in Compare, hash, and std::equal_to (content-equality across managed/supervised).
    • Add operator==/!= for AqlValue.
  • Tests:
    • Add tests/Aql/AqlValueSupervisedTest.cpp covering construction, memory accounting, accessors, conversions, cloning, comparison, and destruction for supervised slices.
    • Update tests/Basics/SupervisedBufferTest.cpp to use new ctor signatures; include new test in tests/CMakeLists.txt.

Written by Cursor Bugbot for commit 676a00c. This will update automatically on new commits. Configure here.

@cla-bot cla-bot bot added the cla-signed label Oct 10, 2025
@cpjulia cpjulia changed the title Feature/supervised aql value [DO NOT MERGE] Feature/supervised aql value Oct 10, 2025
@cpjulia cpjulia added this to the devel milestone Oct 21, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: ID Extraction Lacks Resource Monitoring

In the get function with vector of names, when s.isCustom() is true and the path ends with _id, the returned AqlValue from extractIdString doesn't receive the rm (ResourceMonitor) parameter. This causes memory accounting inconsistency when the source is a VPACK_SUPERVISED_SLICE, similar to the bug in getIdAttribute at line 436.

arangod/Aql/AqlValue.cpp#L591-L598

return AqlValue{AqlValueHintNull{}};
} else if (s.isCustom()) {
// _id needs special treatment
if (i + 1 == n) {
// x.y._id
mustDestroy = true;
return AqlValue(
transaction::helpers::extractIdString(&resolver, s, prev));

Fix in CursorΒ Fix in Web


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants