GithubHelp home page GithubHelp logo

Comments (6)

silver-ymz avatar silver-ymz commented on September 26, 2024

I meet some problems when implementing this feature.

Current behavior of concurrent index building is validate_index function causes segmentation fault in indexcmds.c. I have already found the reason. Postgres validate_index will use bulkdelete callback to gather all the TIDs currently in the index which mentioned in postgres src here. But our implementation of ambulkdelete assumes that the callback is vac_tid_reaped and directly reinterpret callback_state to VacDeadItems. Actually, the callback state passed by validate_index isn't VacDeadItems. The incorrect reinterpretation here caused segmentation fault.

Since we don't use postgres storage system, it seems impossible to construct an ItemPointer and pass it to bulkdelete callback function. My question is how to modify the ambulkdelete function to support general callback functions, and then complete this feature.

Could you give some advices? @VoVAllen @usamoi

from pgvecto.rs.

usamoi avatar usamoi commented on September 26, 2024

It's not necessary to support a general bulkdelete callback. The session process could request for the deletemask in the background process to simulate the behaivor of validate_index_callback.

from pgvecto.rs.

silver-ymz avatar silver-ymz commented on September 26, 2024

There seems to be no way to determine whether the callback parameter is validate_index_callback or vac_tid_reaped.

from pgvecto.rs.

VoVAllen avatar VoVAllen commented on September 26, 2024

I think there're some option to know whether the operation is reindex. You can check postgis or timescale for reference.

from pgvecto.rs.

usamoi avatar usamoi commented on September 26, 2024

Maybe we can use a dirt solution if we do not know how. ivinfo.report_progress is different in vacauum routine and define_index routine.

from pgvecto.rs.

VoVAllen avatar VoVAllen commented on September 26, 2024

Some answer from sourcegraph cody ai, not sure it's right or not

Lookup the relation in the cache and get a pointer to its RelFileNode struct:
Relation rel = RelationIdGetRelation(relid);
RelFileNode *relfilenode = rel->rd_node;
Examine the relfilenode->spcNode value:
If it is equal to MyDatabaseTableSpace, then we are in index validation
If it is equal to MyDatabaseTableSpace_fsm or MyDatabaseTableSpace_vm, then we are in VACUUM
For example:

Copy
if (relfilenode->spcNode == MyDatabaseTableSpace) {
// Index validation
}
else if (relfilenode->spcNode == MyDatabaseTableSpace_fsm ||
relfilenode->spcNode == MyDatabaseTableSpace_vm) {
// VACUUM
}
This checks the tablespace of the relation to determine the current stage.

from pgvecto.rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.