Skip to content

Commit e1d8ffc

Browse files
sql_cacher: add support for reads of sql_cached_value while table is being reloaded
1 parent c7f99ee commit e1d8ffc

File tree

4 files changed

+181
-43
lines changed

4 files changed

+181
-43
lines changed

atomic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#undef NO_ATOMIC_OPS
4444

4545
typedef _Atomic(unsigned long) atomic_t;
46+
typedef _Atomic(_Bool) atomic_bool_t;
4647
#else /* HAVE_STDATOMIC */
4748

4849
/************************* i386 & x86_64 ARCH ****************************/
@@ -72,6 +73,7 @@ typedef _Atomic(unsigned long) atomic_t;
7273
* not some alias that contains the same information.
7374
*/
7475
typedef struct { volatile unsigned int counter; } atomic_t;
76+
typedef atomic_t atomic_bool_t;
7577

7678
/*! \brief
7779
* atomic_add - add integer to atomic variable
@@ -141,6 +143,7 @@ static __inline__ void atomic_dec(atomic_t *v)
141143
* not some alias that contains the same information.
142144
*/
143145
typedef struct { volatile unsigned long counter; } atomic_t;
146+
typedef atomic_t atomic_bool_t;
144147

145148
/*! \brief
146149
* atomic_set - set atomic variable

modules/sql_cacher/README

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ Chapter 1. Admin Guide
148148
* expire : expire period for the values stored in the cache
149149
for the on demand caching type in seconds
150150
If not present, default value is “1 hour”
151+
* full_caching_lock_scope : whether to lock reading from the cache
152+
when loading the table into the cache on a row or table basis
153+
with it set to “table” large tables writing into the cache can
154+
block reads when reading an sql_cached_value from that table
155+
stalling the SIP processing but ensures full table consistency,
156+
“row” allows reads during writing on rows not currently being written to.
157+
+ row
158+
+ table
159+
If not present, default value is “row”
151160

152161
The parameters must be given in the exact order specified
153162
above.
@@ -164,7 +173,8 @@ cachedb_url=mongodb:mycluster://127.0.0.1:27017/db.col
164173
table=table_name
165174
key=column_name_0
166175
columns=column_name_1 column_name_2 column_name_3
167-
on_demand=0")
176+
on_demand=0
177+
full_caching_lock_scope=row")
168178

169179

170180
1.3.2. spec_delimiter (string)

0 commit comments

Comments
 (0)