Fix gpexpand 'SyncPackages object has no attribute ret': enqueue OperationWorkerPool operations via items=#1826
Open
talmacschen-arch wants to merge 1 commit into
Conversation
OperationWorkerPool.__init__ passed its operations positionally to
WorkerPool.__init__, whose second positional parameter is should_stop
(items is the third). As a result operations were bound to should_stop
and items stayed None, so no operation was ever added to the work queue
and should_stop was set truthy. The worker only received the halt
command, ParallelOperation's operations never ran, Operation.run() never
assigned self.ret, and callers hit:
AttributeError: 'SyncPackages' object has no attribute 'ret'
This breaks gpexpand's first stage ("Syncing Apache Cloudberry
extensions"): the exception is squashed to a WARNING and, more
importantly, package/extension sync to new segment hosts silently never
runs.
This re-applies the fix from commit cd3c88f, which was reverted by
the REL_16_9 merge (0f4cf8d). Pass operations as the items keyword
so they are enqueued and should_stop stays False.
Contributor
|
We have lost fix https://github.com/apache/cloudberry/pull/1716/changes while rebasing. Maybe we should just cherry-pick fix from PG14_ARCHIVE to main branch? |
Member
+1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1825.
OperationWorkerPool.__init__passed itsoperationspositionally toWorkerPool.__init__:But
WorkerPool.__init__'s second positional parameter isshould_stop, and the work items are the third parameteritems:So
operationsbound toshould_stop(a truthy list) anditemsstayedNone. Consequently no operation was ever added to the work queue,should_stopwas set truthy, the worker only ever received the halt command, and the submitted operations never ran.Operation.run()therefore never assignedself.ret, and callers hit:This breaks the first stage of
gpexpand("Syncing Apache Cloudberry extensions"): the exception is squashed into aWARNING, and — more importantly — package/extension synchronization to new segment hosts silently never runs.Fix
Pass the operations as the
itemskeyword argument so they are enqueued andshould_stopstaysFalse:This re-applies commit
cd3c88f6e1e("Fix gppkg error: 'SyncPackages' object has no attribute 'ret'."), which was inadvertently reverted by theMerge tag 'REL_16_9' into Cloudberrymerge (0f4cf8d5068). On currentmain,grep -c "items=operations" gpMgmt/bin/gppylib/commands/base.pyreturns0.Testing
gpexpand -i <input> -vfirst stage no longer raises theAttributeError; theSyncPackagesoperation now actually executes (the-vlog shows the worker receiving the operation instead of only a halt command).See #1825 for the full root-cause analysis and the regression history.