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

New series of ao/co - related cherry-picks #897

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

reshke
Copy link
Contributor

@reshke reshke commented Jan 28, 2025

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@reshke reshke added the cherry-pick cherry-pick upstream commts label Jan 28, 2025
@x4m
Copy link
Contributor

x4m commented Jan 29, 2025

uhhm, ic-isolation2 is flapping? or is it real fail?

@yjhjstz
Copy link
Member

yjhjstz commented Jan 29, 2025

uhhm, ic-isolation2 is flapping? or is it real fail?

never see those failures .

soumyadeep2007 and others added 5 commits January 29, 2025 17:25
Though no special code was written for unique indexes in the context of
repeatable read transaction isolation, add a smoke test:

* For added coverage
* To illustrate how unique index checks cross transaction isolation
boundaries.
We don't have to do anything special for partial indexes. Keys not
satisfying the partial index predicate are never inserted into the
index, and hence there are no uniqueness checks triggered (see
ExecInsertIndexTuples()). Also during partial unique index builds, keys
that don't satisfy the partial index predicate are never inserted into
the index (see *_index_build_range_scan()).

Add smoke tests all the same:

* For added coverage
* For illustrative purposes
Now that unique indexes are supported on AO tables, allow ALTER TABLE
SET ACCESS METHOD TO ao_row|ao_column, on heap tables bearing unique
indexes.
This enables reporting for the table scan phase of index builds on AO
tables. This directly affects:
(1) pg_stat_progress_create_index.blocks_total
(2) pg_stat_progress_create_index.blocks_done

Sample:

Connect in utility mode to a segment, while CREATE INDEX is running on
an AO table:

postgres=# select pid, command, phase, blocks_total, blocks_done from pg_stat_progress_create_index;
  pid   |   command    |             phase              | blocks_total | blocks_done
--------+--------------+--------------------------------+--------------+-------------
 633034 | CREATE INDEX | building index: scanning table |        54993 |        4412
(1 row)

This commit introduces:

(1) Accounting in AppendOnlyScanDescData to track the total number of
bytes read across all segment files. It is updated whenever a new block
is read. If the block is compressed, its compressed length is added
(uncompressed length otherwise).

(2) Reporting code in appendonly_index_build_range_scan() to report in
increments of BLCKSZ, the number of blocks scanned so far. The total
number of blocks to be scanned is also published up front and is
determined by summing the compressed eof values of all segfiles.

(3) Marks RelationGuessNumberOfBlocksFromSize() as inline, since it is
now being called in a much hotter code path.

Note: We currently only support reporting for non-concurrent index
builds and serial builds.
@reshke
Copy link
Contributor Author

reshke commented Jan 29, 2025

that a real issue with new test

-- Wait until some AO varblocks have been read.
SELECT gp_wait_until_triggered_fault('AppendOnlyStorageRead_ReadNextBlock_success', 10, dbid) FROM gp_segment_configuration WHERE content = 1 AND role = 'p';

I fought I fixed it

@reshke
Copy link
Contributor Author

reshke commented Jan 29, 2025

happy new year by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick cherry-pick upstream commts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants