sync:data doesn't work in an edge case
If getSynchronizationDataQueryExpanderStrategyPlugin() returns the "WhereBetween" plugin as it does in spryker-suite:
and the auto-increment id in spy_product_abstract_page_search and/or spy_product_concrete_page_search doesn't start from zero (or technically between 0 and chunk size), then sync:data product_abstract and sync:data product_concrete fail to query data from those tables.
The reason being that their iterators start by querying the tables like:SELECT FROM `spy_product_abstract_page_search` WHERE id_product_abstract_page_search BETWEEN 0 AND 100 ORDER BY `spy_product_abstract_page_search`.`id_product_abstract_page_search` ASC
and obviously if the first id is 101 or 46249, the query returns nothing → iterator stops → nothing gets synced.
Changing the plugin to SynchronizationDataQueryExpanderOffsetLimitStrategyPlugin seems to work.
Comments
-
Die Sync plugin sollen in dieser Fall implementieren das Interface `
SynchronizationDataMaxIterationLimitPluginInterface
` und implementieren die Function `getMaxIterationLimit
` um genau das Problem umzugehenSpecification
/**
* Provides maxIterationLimit for SynchronizationDataPluginIterator.
*
* Implement this interface if you need to set an explicit maxIterationLimit.
* The Iterator can proceed until maxIterationLimit is reached even if intermittent result sets are empty.
*
* @see \Spryker\Zed\Synchronization\Business\Iterator\SynchronizationDataBulkRepositoryPluginIterator
*/
0 -
To avoid this problem u have to implement the Interface \Spryker\Zed\SynchronizationExtension\Dependency\Plugin\SynchronizationDataMaxIterationLimitPluginInterface and implement the method getMaxIterationLimit . In this case the iteration is stopped at first the max iteration limit is reached.
The specification of this interface say:
The Iterator can proceed until maxIterationLimit is reached even if intermittent result sets are empty.2
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 68 Spryker News
- 890 Developer Corner
- 753 Spryker Development
- 83 Spryker Dev Environment
- 360 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 22 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random