Revert "List pagination locking for state-data changes"
This reverts commit eea6d549f6.
This commit is contained in:
parent
eea6d549f6
commit
52744c9301
5 changed files with 19 additions and 25 deletions
|
|
@ -592,16 +592,11 @@ get_list_pagination(clicon_handle h,
|
|||
#endif
|
||||
}
|
||||
else {/* Check if running locked (by this session) */
|
||||
if ((iddb = xmldb_islocked(h, PAGINATE_STATE_LOCK)) != 0){
|
||||
if (iddb == ce->ce_id)
|
||||
locked = 1;
|
||||
else
|
||||
locked = 0;
|
||||
}
|
||||
else {
|
||||
xmldb_lock(h, PAGINATE_STATE_LOCK, ce->ce_id);
|
||||
if ((iddb = xmldb_islocked(h, "running")) != 0 &&
|
||||
iddb == ce->ce_id)
|
||||
locked = 1;
|
||||
}
|
||||
else
|
||||
locked = 0;
|
||||
if ((ret = clixon_pagination_cb_call(h, xpath, locked,
|
||||
offset, limit,
|
||||
xret)) < 0)
|
||||
|
|
|
|||
|
|
@ -38,11 +38,6 @@
|
|||
#ifndef _CLIXON_BACKEND_PLUGIN_H_
|
||||
#define _CLIXON_BACKEND_PLUGIN_H_
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
#define PAGINATE_STATE_LOCK "paginate-state-lock"
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -309,16 +309,15 @@ pagination_limit(pagination_data pd)
|
|||
return ((pagination_data_t *)pd)->pd_limit;
|
||||
}
|
||||
|
||||
/*! Get pagination data: locked parameter for state data
|
||||
/*! Get pagination data: locked parameter
|
||||
*
|
||||
* A "paginate" lock is set for a specific session when list-pagination is in progress.
|
||||
* If locking is set, the pagination is part of a session transaction and the plugin may
|
||||
* cache state (such as a cache) and can expect more pagination calls until the "paginate"
|
||||
* db-lock is released.
|
||||
*
|
||||
* If you want to do the same for config data, it is recommended to use lock-db on
|
||||
* the appropriate database, but this risks of indefinite blocking, as long as the
|
||||
* session endures.
|
||||
* Pagination can use a lock/transaction mechanism
|
||||
* If locking is not used, the plugin cannot expect more pagination calls, and no state or
|
||||
* caching should be used
|
||||
* If locking is used, the pagination is part of a session transaction and the plugin may cache
|
||||
* state (such as a cache) and can expect more pagination calls until the running db-lock is
|
||||
* released, (see ca_lockdb)
|
||||
* The transaction is the regular lock/unlock db of running-db of a specific session.
|
||||
* @param[in] pd Pagination userdata
|
||||
* @retval locked 0: unlocked/stateless 1: locked by this caller
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue