forked from github/onyx
fix unpaused user files (#5205)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""Pause finished user file connectors
|
||||
|
||||
Revision ID: b558f51620b4
|
||||
Revises: 90e3b9af7da4
|
||||
Create Date: 2025-08-15 17:17:02.456704
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "b558f51620b4"
|
||||
down_revision = "90e3b9af7da4"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# Set all user file connector credential pairs with ACTIVE status to PAUSED
|
||||
# This ensures user files don't continue to run indexing tasks after processing
|
||||
op.execute(
|
||||
"""
|
||||
UPDATE connector_credential_pair
|
||||
SET status = 'PAUSED'
|
||||
WHERE is_user_file = true
|
||||
AND status = 'ACTIVE'
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
pass
|
||||
@@ -505,7 +505,14 @@ def check_indexing_completion(
|
||||
ConnectorCredentialPairStatus.SCHEDULED,
|
||||
ConnectorCredentialPairStatus.INITIAL_INDEXING,
|
||||
]:
|
||||
cc_pair.status = ConnectorCredentialPairStatus.ACTIVE
|
||||
# User file connectors must be paused on success
|
||||
# NOTE: _run_indexing doesn't update connectors if the index attempt is the future embedding model
|
||||
# TODO: figure out why this doesn't pause connectors during swap
|
||||
cc_pair.status = (
|
||||
ConnectorCredentialPairStatus.PAUSED
|
||||
if cc_pair.is_user_file
|
||||
else ConnectorCredentialPairStatus.ACTIVE
|
||||
)
|
||||
db_session.commit()
|
||||
|
||||
# Clear repeated error state on success
|
||||
|
||||
@@ -271,7 +271,7 @@ def _check_failure_threshold(
|
||||
|
||||
# NOTE: this is the old run_indexing function that the new decoupled approach
|
||||
# is based on. Leaving this for comparison purposes, but if you see this comment
|
||||
# has been here for >1 month, please delete this function.
|
||||
# has been here for >2 month, please delete this function.
|
||||
def _run_indexing(
|
||||
db_session: Session,
|
||||
index_attempt_id: int,
|
||||
|
||||
@@ -154,6 +154,9 @@ export default function UpgradingPage({
|
||||
re-indexed successfully, the new model will be used for all
|
||||
search queries. Until then, we will use the old model so
|
||||
that no downtime is necessary during this transition.
|
||||
<br />
|
||||
Note: User file re-indexing progress is not shown. You will
|
||||
see this page until all user files are re-indexed!
|
||||
</Text>
|
||||
|
||||
{sortedReindexingProgress ? (
|
||||
|
||||
Reference in New Issue
Block a user