Skip to content

Commit ec0d6d7

Browse files
committed
Changed to keep map of DNS addresses due to 5 second DNS delays.
1 parent 914341a commit ec0d6d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+467
-496
lines changed

admin/templates/configuration/etc/log4cxx.index.properties

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
# export LSST_LOG_CONFIG=$HOME/.lsst/log4cxx.unittest.properties
66
#
77

8-
#log4j.rootLogger=INFO, CONSOLE
9-
log4j.rootLogger=DEBUG, CONSOLE
8+
log4j.rootLogger=INFO, CONSOLE
9+
#log4j.rootLogger=DEBUG, CONSOLE
10+
#log4j.rootLogger=WARN, CONSOLE
1011

1112
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
1213
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Configuration file for log4cxx
3+
# can be used for unit test
4+
# by launching next command before unit tests:
5+
# export LSST_LOG_CONFIG=$HOME/.lsst/log4cxx.unittest.properties
6+
#
7+
8+
#log4j.rootLogger=INFO, CONSOLE
9+
log4j.rootLogger=DEBUG, CONSOLE
10+
#log4j.rootLogger=WARN, CONSOLE
11+
12+
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
13+
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
14+
#log4j.appender.CONSOLE.layout.ConversionPattern=[%d{yyyy-MM-ddTHH:mm:ss.SSSZ}] [%t] %-5p %c{2} (%F:%L) - %m%n
15+
log4j.appender.CONSOLE.layout.ConversionPattern=[%d{ddTHH:mm:ss.SSSZ}] [%t] %-5p %c{2} (%F:%L) - %m%n
16+
17+
# Tune log at the module level
18+
#log4j.logger.lsst.qserv.util=DEBUG

admin/tools/docker/index/container/dev/README

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# These are the optional building steps (in case if this container needs to
77
# be rebuilt from scratch (which is going to take ~2 hours or longer)
88

9-
#docker build -t qserv/replica:dev . &&&
10-
#docker push qserv/replica:dev &&&
119
docker build -t qserv/loaderbase:dev .
1210
docker push qserv/loaderbase:dev
1311

admin/tools/docker/index/container/dev/master/appMaster.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ source /qserv/stack/loadLSST.bash
1313
cd /home/qserv/dev/qserv
1414
setup -r . -t qserv-dev
1515

16-
export LSST_LOG_CONFIG=/home/qserv/dev/qserv/admin/templates/configuration/etc/log4cxx.index.properties
16+
export LSST_LOG_CONFIG=/home/qserv/dev/qserv/admin/templates/configuration/etc/log4cxx.index_master.properties
1717

1818
/home/qserv/dev/qserv/build/loader/appMaster /home/qserv/dev/qserv/core/modules/loader/config/master.cnf
1919

admin/tools/docker/index/index-k8-10m.yaml

+214-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
apiVersion: v1
2-
kind: Service
31
metadata:
42
name: imaster-svc
53
labels:
@@ -61,7 +59,7 @@ metadata:
6159
spec:
6260
serviceName: iworker-svc
6361
podManagementPolicy: Parallel
64-
replicas: 3
62+
replicas: 14
6563
selector:
6664
matchLabels:
6765
app: iworker-pod
@@ -116,7 +114,7 @@ spec:
116114
- name: iclientnum-ctr
117115
image: qserv/indexclientnum:dev
118116
imagePullPolicy: Always
119-
args: ["1000000", "1", "client-k8s-a1.cnf"]
117+
args: ["10000000", "1", "client-k8s-a1.cnf"]
120118
ports:
121119
- containerPort: 10050
122120
protocol: UDP
@@ -157,7 +155,7 @@ spec:
157155
- name: iclientnum2-ctr
158156
image: qserv/indexclientnum:dev
159157
imagePullPolicy: Always
160-
args: ["2000001", "3000001", "client-k8s-a2.cnf"]
158+
args: ["20000001", "30000001", "client-k8s-a2.cnf"]
161159
ports:
162160
- containerPort: 10050
163161
protocol: UDP
@@ -198,9 +196,218 @@ spec:
198196
- name: iclientnum3-ctr
199197
image: qserv/indexclientnum:dev
200198
imagePullPolicy: Always
201-
args: ["1000001", "2000000", "client-k8s-a3.cnf"]
199+
args: ["10000001", "20000000", "client-k8s-a3.cnf"]
200+
ports:
201+
- containerPort: 10050
202+
protocol: UDP
203+
204+
---
205+
apiVersion: v1
206+
kind: Service
207+
metadata:
208+
name: iclientnum4-svc
209+
labels:
210+
app: index
211+
spec:
212+
ports:
213+
- port: 10050
214+
protocol: UDP
215+
clusterIP: None
216+
selector:
217+
app: iclientnum4-pod
218+
---
219+
apiVersion: apps/v1
220+
kind: StatefulSet
221+
metadata:
222+
name: iclientnum4-sts
223+
labels:
224+
app: index
225+
spec:
226+
serviceName: iclientnum4-svc
227+
podManagementPolicy: Parallel
228+
replicas: 1
229+
selector:
230+
matchLabels:
231+
app: iclientnum4-pod
232+
template:
233+
metadata:
234+
labels:
235+
app: iclientnum4-pod
236+
spec:
237+
containers:
238+
- name: iclientnum3-ctr
239+
image: qserv/indexclientnum:dev
240+
imagePullPolicy: Always
241+
args: ["40000001", "50000000", "client-k8s-a1.cnf"]
202242
ports:
203243
- containerPort: 10050
204-
protocol: UDP
244+
protocol: UDP
205245

246+
---
247+
apiVersion: v1
248+
kind: Service
249+
metadata:
250+
name: iclientnum5-svc
251+
labels:
252+
app: index
253+
spec:
254+
ports:
255+
- port: 10050
256+
protocol: UDP
257+
clusterIP: None
258+
selector:
259+
app: iclientnum5-pod
260+
---
261+
apiVersion: apps/v1
262+
kind: StatefulSet
263+
metadata:
264+
name: iclientnum5-sts
265+
labels:
266+
app: index
267+
spec:
268+
serviceName: iclientnum5-svc
269+
podManagementPolicy: Parallel
270+
replicas: 1
271+
selector:
272+
matchLabels:
273+
app: iclientnum5-pod
274+
template:
275+
metadata:
276+
labels:
277+
app: iclientnum5-pod
278+
spec:
279+
containers:
280+
- name: iclientnum5-ctr
281+
image: qserv/indexclientnum:dev
282+
imagePullPolicy: Always
283+
args: ["50000001", "60000000", "client-k8s-a1.cnf"]
284+
ports:
285+
- containerPort: 10050
286+
protocol: UDP
287+
288+
---
289+
apiVersion: v1
290+
kind: Service
291+
metadata:
292+
name: iclientnum6-svc
293+
labels:
294+
app: index
295+
spec:
296+
ports:
297+
- port: 10050
298+
protocol: UDP
299+
clusterIP: None
300+
selector:
301+
app: iclientnum6-pod
302+
---
303+
apiVersion: apps/v1
304+
kind: StatefulSet
305+
metadata:
306+
name: iclientnum6-sts
307+
labels:
308+
app: index
309+
spec:
310+
serviceName: iclientnum6-svc
311+
podManagementPolicy: Parallel
312+
replicas: 1
313+
selector:
314+
matchLabels:
315+
app: iclientnum6-pod
316+
template:
317+
metadata:
318+
labels:
319+
app: iclientnum6-pod
320+
spec:
321+
containers:
322+
- name: iclientnum6-ctr
323+
image: qserv/indexclientnum:dev
324+
imagePullPolicy: Always
325+
args: ["60000001", "70000000", "client-k8s-a1.cnf"]
326+
ports:
327+
- containerPort: 10050
328+
protocol: UDP
329+
330+
---
331+
apiVersion: v1
332+
kind: Service
333+
metadata:
334+
name: iclientnum7-svc
335+
labels:
336+
app: index
337+
spec:
338+
ports:
339+
- port: 10050
340+
protocol: UDP
341+
clusterIP: None
342+
selector:
343+
app: iclientnum7-pod
344+
---
345+
apiVersion: apps/v1
346+
kind: StatefulSet
347+
metadata:
348+
name: iclientnum7-sts
349+
labels:
350+
app: index
351+
spec:
352+
serviceName: iclientnum7-svc
353+
podManagementPolicy: Parallel
354+
replicas: 1
355+
selector:
356+
matchLabels:
357+
app: iclientnum7-pod
358+
template:
359+
metadata:
360+
labels:
361+
app: iclientnum7-pod
362+
spec:
363+
containers:
364+
- name: iclientnum7-ctr
365+
image: qserv/indexclientnum:dev
366+
imagePullPolicy: Always
367+
args: ["70000001", "80000000", "client-k8s-a1.cnf"]
368+
ports:
369+
- containerPort: 10050
370+
protocol: UDP
371+
372+
---
373+
apiVersion: v1
374+
kind: Service
375+
metadata:
376+
name: iclientnum8-svc
377+
labels:
378+
app: index
379+
spec:
380+
ports:
381+
- port: 10050
382+
protocol: UDP
383+
clusterIP: None
384+
selector:
385+
app: iclientnum8-pod
386+
---
387+
apiVersion: apps/v1
388+
kind: StatefulSet
389+
metadata:
390+
name: iclientnum8-sts
391+
labels:
392+
app: index
393+
spec:
394+
serviceName: iclientnum8-svc
395+
podManagementPolicy: Parallel
396+
replicas: 1
397+
selector:
398+
matchLabels:
399+
app: iclientnum8-pod
400+
template:
401+
metadata:
402+
labels:
403+
app: iclientnum8-pod
404+
spec:
405+
containers:
406+
- name: iclientnum8-ctr
407+
image: qserv/indexclientnum:dev
408+
imagePullPolicy: Always
409+
args: ["80000001", "90000000", "client-k8s-a1.cnf"]
410+
ports:
411+
- containerPort: 10050
412+
protocol: UDP
206413

core/modules/loader/BufferUdp.cc

+6-19
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ MsgElement::Ptr BufferUdp::readFromSocket(boost::asio::ip::tcp::socket& socket,
4848

4949
// If there's something in the buffer already, get it and return.
5050
// This can happen when the previous read of socket read multiple elements.
51-
MsgElement::Ptr msgElem = _safeRetrieve("1readFromSocket&&&" + note);
51+
MsgElement::Ptr msgElem = _safeRetrieve("1readFromSocket" + note);
5252
if (msgElem != nullptr) {
5353
return msgElem;
5454
}
@@ -69,7 +69,7 @@ MsgElement::Ptr BufferUdp::readFromSocket(boost::asio::ip::tcp::socket& socket,
6969

7070
/// Try to retrieve an element (there's no guarantee that an entire element got read in a single read.
7171
// Store original cursor positions so they can be restored if the read fails.
72-
msgElem = _safeRetrieve("2readFromSocket&&&" + note);
72+
msgElem = _safeRetrieve("2readFromSocket" + note);
7373
if (msgElem != nullptr) {
7474
return msgElem;
7575
}
@@ -117,11 +117,11 @@ void BufferUdp::advanceReadCursor(size_t len) {
117117
}
118118

119119

120-
std::shared_ptr<MsgElement> BufferUdp::_safeRetrieve(std::string const& note) { // &&& delete note, maybe
120+
std::shared_ptr<MsgElement> BufferUdp::_safeRetrieve(std::string const& note) {
121121
auto wCursorOriginal = _wCursor;
122122
auto rCursorOriginal = _rCursor;
123123
// throwOnMissing=false since missing data is possible with TCP.
124-
MsgElement::Ptr msgElem = MsgElement::retrieve(*this, note + " _safeRetrieve &&&", false);
124+
MsgElement::Ptr msgElem = MsgElement::retrieve(*this, note + " _safeRetrieve", false);
125125
if (msgElem != nullptr) {
126126
return msgElem;
127127
} else {
@@ -134,20 +134,7 @@ std::shared_ptr<MsgElement> BufferUdp::_safeRetrieve(std::string const& note) {
134134

135135
bool BufferUdp::isRetrieveSafe(size_t len) const {
136136
auto newLen = (_rCursor + len);
137-
// &&&return (newLen <= _end && newLen <= _wCursor);
138-
bool res = (newLen <= _end && newLen <= _wCursor); // &&&
139-
if (!res) { // &&&
140-
LOGS(_log, LOG_LVL_WARN, "&&& BufferUdp::isRetrieveSafe not safe len=" << len <<
141-
" rCursor=" << (void*)_rCursor <<
142-
" newLen=" << (void*)newLen <<
143-
" wCursor=" << (void*)_wCursor <<
144-
" _end=" << (void*)_end <<
145-
" (newLen<=end)=" << (newLen <= _end) <<
146-
" (newLen<=_wCursor)=" << (newLen <= _wCursor) <<
147-
" res=" << res);
148-
LOGS(_log, LOG_LVL_WARN, "&&& BufferUdp::isRetrieveSafe " << dumpStr(false));
149-
}
150-
return res;
137+
return (newLen <= _end && newLen <= _wCursor);
151138
}
152139

153140

@@ -157,7 +144,7 @@ bool BufferUdp::retrieve(void* out, size_t len) {
157144
_rCursor += len;
158145
return true;
159146
}
160-
LOGS(_log, LOG_LVL_WARN, "&&& BufferUdp::retrieve not safe len=" << len);
147+
LOGS(_log, LOG_LVL_DEBUG, "BufferUdp::retrieve not safe len=" << len);
161148
return false;
162149
}
163150

core/modules/loader/BufferUdp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class MsgElement;
4646

4747
/// A buffer for reading and writing. Nothing can be read from the buffer until
4848
/// something has been written to it.
49-
/// TODO: rename BufferUdp is not really accurate anymore. &&&
49+
/// TODO: rename BufferUdp is not really accurate anymore.
5050
class BufferUdp {
5151
public:
5252
using Ptr = std::shared_ptr<BufferUdp>;

core/modules/loader/Central.cc

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ void Central::_checkDoList() {
7777
while(_loop) {
7878
// Run and then sleep for a second. TODO A more advanced timer should be used
7979
doList->checkList();
80-
LOGS(_log, LOG_LVL_INFO, "&&& SLEEP");
8180
usleep(_loopSleepTime);
8281
}
8382
}

0 commit comments

Comments
 (0)