Skip to content

First variant of depends tracking - works only for procedures - #9125

Open
AlexPeshkoff wants to merge 63 commits into
masterfrom
depend_update
Open

AlexPeshkoff wants to merge 63 commits into
masterfrom
depend_update

Conversation

@AlexPeshkoff

Copy link
Copy Markdown
Member

I present for early review solution that should solve some "regressions" with new metadata cache. Word regressions is quoted cause pre-fb6 some specific changes in database (like changed number of output procedure parameters) under some circumstances kept dependent objects working correctly without recompile of that dependent objects. That was pure lucky cases among other failing - but people used that and do not get format outdated error instead.

The overall idea is simple - if one needs to do some breaking changes in a set of objects (currently only procedures but others will work in same manner) this can be done in single transaction and everything needed will be recompiled on commit. Certainly that commit fails if compilation fails - but one can fix errors and repeat commit.

This PR is not ready for merge yet (all objects to be taken into an account) - but one who interested can play with procedures right now.

@AlexPeshkoff AlexPeshkoff self-assigned this Aug 14, 2026
AlexPeshkoff and others added 28 commits August 15, 2026 20:46
…format` for `blr_int128` (#9124)

Co-authored-by: Artyom Ivanov <artyom.ivanov@red-soft.ru>
…he specified plan' when the query contains a LEFT OUTER JOIN
Co-authored-by: asfernandes <asfernandes@users.noreply.github.com>
…f our internal allocator (#9152)

Co-authored-by: Artyom Ivanov <artyom.ivanov@red-soft.ru>
…res in numeric literals (SQL:2023 T662) (#8564)

* Adding SQL-compliant names to existing MAXVALUE/MINVALUE functions

* Correcting the description. Adding words to keyword_or_column

* Improved description

* Add support non-decimal integer literals and underscores in numeric literals

* Fix numeric literals lexer after merge with master

  - Restore introducer handling lost in the merge: the lexer returns
    INTRODUCER only and the charset name is parsed by the grammar
    (schema_opt_qualified_name). Keep the T662 check for an underscore
    before a digit or a period.
  - Restore constexpr/noexcept in chars.h and const in Parser.cpp
    lost in the merge.
  - Return LIMIT64_INT/LIMIT64_NUMBER for exactly MAX_SINT64 + 1
    (decimal and non-decimal), so START WITH and SET GENERATOR accept
    -9223372036854775808 and -0x8000000000000000 again.
  - Keep data types of decimal literals unchanged: remove the DBL_DIG
    rule (16+ fractional digits produced DECFLOAT), use DECFLOAT for
    an approximate literal with a mantissa wider than 64 bits or
    |exponent| > DBL_MAX_10_EXP, and for scale < MIN_SCHAR.
  - Follow the README grammar: accept "1." and reject "1e", "1e+"
    and "1e-".
  - README: fix examples and the <mantissa> rule, describe data types
    of non-decimal literals and the incompatibility with old
    hexadecimal literals.
…ed when a comparison references a field with the same field id from another table
dyemanov and others added 30 commits November 20, 2026 18:46
Reuse the format already held by rpb_record when fmt_version matches rpb_format_number instead of resolving it via RelationPermanent::getFormat() for every record.
get_pointer_page() checked the pointer page count on every call, so the record path acquired and released a SharedReadVector hazard pointer (and pinned a generation) just to decide whether a rescan was needed. The same applied to hasData() and getPointerPageCount().

Keep a mirror count updated by the single writer under m_mutex after the vector mutation. Callers that also need page numbers now hold one accessor for the whole operation and resolve values through the new getPointerPage(accessor, sequence) overload, so a single hazard pointer covers both the bound check and the lookup.

Add assertions to validate the new logic. Some minor refactoring to cover repeating usage patterns.
getIndexSlot() redirected an irt_migrate slot to its back slot for every transaction other than the migration owner, even after it had committed. As a result the new index was never exposed, migration finalization never ran, and BTR_all() omitted the index entirely. Stop redirecting once the migration is committed and allow setNormal() from irt_migrate.
GroupedCountsArray::operator[] inlined both the SortedArray lookup and the
insertion branch into every RuntimeStatistics::bumpValue() call. As bumpValue()
runs three times per page fetch, the inlined slow path gave that function a
104-byte frame and a stack-protector check on each call, even though the
m_lastPos fast path almost always hit.

Move the search and insertion into an out-of-line findOrAdd() and keep only the
m_lastPos check inline. The fast path becomes leaf-like, and bumpValue() is then
small enough to be inlined into bumpStats(), which is called once per fetch.
The two template instantiations are emitted explicitly in RuntimeStatistics.cpp,
as the slow path is used from other translation units.

Measured on 500k rows (callgrind, single scan pass): 49M fewer instructions
(2.9%) and ~5% lower wall time, with the page statistics path dropping from
134 to 69 instructions per fetch.
fastRemove() (and the accessor advance after it) may regenerate tree keys,
and for BePlusTree<SecurityClass*> / BePlusTree<Segment*> the key generator
dereferences the pointed object. Deleting the object before removing it
therefore reads freed memory once the tree spans more than one leaf page.
record_param::getWindow(tdbb) resolved the relation pages on every call only to assign the window's page space, even when the window already held a page fetched from that same relation. Called once per record from DPM_next and VIO_data, and from every CCH_RELEASE, it made getBasePages() one of the top costs of a sequential scan.

Skip the lookup when the window already holds a page (its page space is thus initialized), and add a getWindow(pageSpaceId) overload for callers that already have the RelationPages resolved.
Fixed bug #9302 : Rollback of a limbo transaction commits it: gfix -rollback on EOF/empty answer
Fixed bug gh-9301 : SNAPSHOT transaction may miss rows or see later commits if another transaction commits while it is starting
…SELECT after concurrent DROP TABLE commits; fixed a memory leak regression
… into a differently typed column (#9313)

* Fix #9312: crash preparing recursive CTE that copies its first column into a differently typed column
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.

9 participants