[Assorted-commits] SF.net SVN: assorted:[1306] ydb/trunk
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-03-18 19:25:57
|
Revision: 1306 http://assorted.svn.sourceforge.net/assorted/?rev=1306&view=rev Author: yangzhang Date: 2009-03-18 19:25:42 +0000 (Wed, 18 Mar 2009) Log Message: ----------- - tpccdb: fixed buf overflow, h_data should have size MAX_DATA + 1 - general: - fixed the tpcc_response_handler to have proper termination condition - fixed optimized build issues - tested and verified that scaling, rec fully work - test.bash: - added cog to setups - adjusted rec, scaling to use tpcc (and lowered some constants) - added locking - tpcctables: safely delete neworders, avoiding deletion if in serbuf - btree: added conditional compilation of NODE_INNER, NODE_LEAF just to be safe - tpccclient: fixed inverted NDEBUG - tpcc/Makefile: handle OPT - Makefile: use g++ for linking Modified Paths: -------------- ydb/trunk/src/Makefile ydb/trunk/src/main.lzz.clamp ydb/trunk/src/tpcc/Makefile ydb/trunk/src/tpcc/btree.h ydb/trunk/src/tpcc/tpccclient.cc ydb/trunk/src/tpcc/tpccdb.h ydb/trunk/src/tpcc/tpcctables.cc.cog ydb/trunk/tools/test.bash Modified: ydb/trunk/src/Makefile =================================================================== --- ydb/trunk/src/Makefile 2009-03-18 11:40:56 UTC (rev 1305) +++ ydb/trunk/src/Makefile 2009-03-18 19:25:42 UTC (rev 1306) @@ -32,12 +32,12 @@ PPROF := -lprofiler endif ifneq ($(OPT),) - OPT := -O3 -Wdisabled-optimization -DNDEBUG + OPT := -g3 -O3 -Wdisabled-optimization -DNDEBUG else OPT := -g3 endif # CXX := $(WTF) ag++ -k --Xcompiler # $(CXX) -CXX := $(WTF) $(CXX) -pipe +CXX := $(WTF) ccache $(CXX) -pipe LDFLAGS := -pthread $(GPROF) LDLIBS := -lstx -lst -lresolv -lprotobuf -lgtest \ -lboost_program_options-gcc43-mt -lboost_thread-gcc43-mt \ @@ -94,7 +94,7 @@ all: $(TARGET) $(TARGET): $(OBJS) - $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ + $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@ %.pb.o: %.pb.cc %.pb.h $(CXX) -c $(PBCXXFLAGS) $(OUTPUT_OPTION) $< @@ -137,6 +137,7 @@ clean: rm -f $(GENSRCS) $(GENHDRS) $(OBJS) $(TARGET) main.lzz *.clamp_h + make -C tpcc/ clean distclean: clean rm -f all.h all.h.gch Modified: ydb/trunk/src/main.lzz.clamp =================================================================== --- ydb/trunk/src/main.lzz.clamp 2009-03-18 11:40:56 UTC (rev 1305) +++ ydb/trunk/src/main.lzz.clamp 2009-03-18 19:25:42 UTC (rev 1306) @@ -1130,7 +1130,6 @@ finally f(lambda () { long long now = current_time_millis(); - stopped_issuing = true; showtput("processed", now, __ref(start_time), __ref(seqno), __ref(init_seqno)); if (!__ref(caught_up)) { @@ -1738,9 +1737,8 @@ // Read the message, but correctly respond to interrupts so that we can // cleanly exit (slightly tricky). - if (stopped_issuing) { - st_intr intr(stop_hub); - readmsg(reader, res); + if (stopped_issuing && last_seqno + 1 == seqno) { + break; } else { st_intr intr(kill_hub); readmsg(reader, res); @@ -2712,6 +2710,7 @@ long long start_time = current_time_millis(); finally f(lambda () { + stopped_issuing = true; showtput("issued", current_time_millis(), __ref(start_time), __ref(seqno), 0); }); Modified: ydb/trunk/src/tpcc/Makefile =================================================================== --- ydb/trunk/src/tpcc/Makefile 2009-03-18 11:40:56 UTC (rev 1305) +++ ydb/trunk/src/tpcc/Makefile 2009-03-18 19:25:42 UTC (rev 1306) @@ -1,12 +1,15 @@ WARNINGS = -Werror -Wall -Wextra -Wconversion -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Wno-unused-parameter +CXX := ccache $(CXX) + # Debug flags -CXXFLAGS = -g -MD $(WARNINGS) -I.. -std=gnu++0x -# Optimization flags -#CXXFLAGS = -g -O3 -DNDEBUG -MD $(WARNINGS) -std=gnu++0x +ifeq ($(OPT),) + CXXFLAGS = -g3 -MD $(WARNINGS) -std=gnu++0x +else + CXXFLAGS = -g3 -O3 -DNDEBUG -MD $(WARNINGS) -std=gnu++0x +endif # Link withthe C++ standard library -#LDFLAGS=-lstdc++ LDLIBS = -lgtest BINARIES = btree_test.o tpccclient.o tpccgenerator.o tpcctables.o tpccdb.o clock.o randomgenerator.o @@ -18,7 +21,7 @@ %.cc: %.cc.cog cog.py $< > $@ -clean : +clean: rm -f *.o *.d $(BINARIES) -include *.d Modified: ydb/trunk/src/tpcc/btree.h =================================================================== --- ydb/trunk/src/tpcc/btree.h 2009-03-18 11:40:56 UTC (rev 1305) +++ ydb/trunk/src/tpcc/btree.h 2009-03-18 19:25:42 UTC (rev 1306) @@ -280,7 +280,9 @@ private: // Used when debugging +#ifndef NDEBUG enum NodeType {NODE_INNER=0xDEADBEEF, NODE_LEAF=0xC0FFEE}; +#endif // Leaf nodes store pairs of keys and values. struct LeafNode { Modified: ydb/trunk/src/tpcc/tpccclient.cc =================================================================== --- ydb/trunk/src/tpcc/tpccclient.cc 2009-03-18 11:40:56 UTC (rev 1305) +++ ydb/trunk/src/tpcc/tpccclient.cc 2009-03-18 19:25:42 UTC (rev 1306) @@ -68,7 +68,7 @@ vector<DeliveryOrderInfo> orders; db_->delivery(generateWarehouse(), carrier, now, &orders); -#ifdef NDEBUG +#ifndef NDEBUG if (orders.size() != District::NUM_PER_WAREHOUSE) { printf("Only delivered from %zd districts\n", orders.size()); } Modified: ydb/trunk/src/tpcc/tpccdb.h =================================================================== --- ydb/trunk/src/tpcc/tpccdb.h 2009-03-18 11:40:56 UTC (rev 1305) +++ ydb/trunk/src/tpcc/tpccdb.h 2009-03-18 19:25:42 UTC (rev 1306) @@ -211,7 +211,7 @@ int32_t h_w_id; float h_amount; char h_date[DATETIME_SIZE+1]; - char h_data[MAX_DATA]; + char h_data[MAX_DATA+1]; }; // Data returned by the "order status" transaction. Modified: ydb/trunk/src/tpcc/tpcctables.cc.cog =================================================================== --- ydb/trunk/src/tpcc/tpcctables.cc.cog 2009-03-18 11:40:56 UTC (rev 1305) +++ ydb/trunk/src/tpcc/tpcctables.cc.cog 2009-03-18 19:25:42 UTC (rev 1306) @@ -351,7 +351,7 @@ assert(neworder->no_d_id == d_id && neworder->no_w_id == warehouse_id); int32_t o_id = neworder->no_o_id; neworders_.erase(iterator); - delete neworder; + if (!within(serbuf_, neworder)) delete neworder; DeliveryOrderInfo order; order.d_id = d_id; Modified: ydb/trunk/tools/test.bash =================================================================== --- ydb/trunk/tools/test.bash 2009-03-18 11:40:56 UTC (rev 1305) +++ ydb/trunk/tools/test.bash 2009-03-18 19:25:42 UTC (rev 1306) @@ -92,6 +92,37 @@ } # +# Access control +# + +node-lock() { + check-remote + if ! node-islocked ; then + sudo su - -c ' + echo AllowUsers root yang >> /etc/ssh/sshd_config && + /etc/init.d/ssh restart + ' + fi +} + +node-unlock() { + check-remote + sudo su - -c ' + sed -i "/^AllowUsers root yang$/ d" /etc/ssh/sshd_config && + /etc/init.d/ssh restart + ' +} + +node-islocked() { + check-remote + sudo grep '^AllowUsers root yang$' /etc/ssh/sshd_config +} + +lock() { parremote node-lock ; } +unlock() { parremote node-unlock ; } +islocked() { parremote node-islocked ; } + +# # Setup # @@ -191,6 +222,11 @@ PPROF=1 OPT=1 make WTF= ydb } +node-setup-cog() { + check-remote + toast --quiet arm 'http://nedbatchelder.com/code/cog/cog-2.1.tar.gz' +} + init-setup() { parremote node-init-setup } @@ -227,6 +263,7 @@ parremote node-setup-clamp parremote node-setup-gtest parremote node-setup-ghash + parremote node-setup-cog } setup-ydb() { @@ -289,17 +326,17 @@ rec-helper() { local leader=$1 shift - : ${seqno:=1000000} ${extraargs:=} - tagssh $leader "ydb/src/ydb -l --exit-on-recovery --accept-joiner-seqno $seqno -n $(( $# - 1 )) $extraargs" & + : ${seqno:=100000} ${extraargs:=} + tagssh $leader "set -x; ydb/src/ydb --tpcc -l --exit-on-recovery --accept-joiner-seqno $seqno -n $(( $# - 1 )) $extraargs" & sleep .1 # Run initial replicas. while (( $# > 1 )) ; do - tagssh $1 "ydb/src/ydb -H $leader" & + tagssh $1 "set -x; ydb/src/ydb --tpcc -H $leader" & shift done sleep .1 # Run joiner. - tagssh $1 "ydb/src/ydb -H $leader --yield-build-up --yield-catch-up $extraargs" & + tagssh $1 "set -x; ydb/src/ydb --tpcc -H $leader --yield-build-up --yield-catch-up $extraargs" & if false ; then if [[ ${wait2:-} ]] then sleep $wait2 @@ -389,10 +426,10 @@ scaling-helper() { local leader=$1 shift - tagssh $leader "CPUPROFILE=ydb.prof ydb/src/ydb -q -l -n $# -X 1000000 ${extraargs:-}" & + tagssh $leader "CPUPROFILE=ydb.prof ydb/src/ydb -q -l -n $# -X 100000 --tpcc ${extraargs:-}" & sleep .1 for rep in "$@" - do tagssh $rep "CPUPROFILE=ydb.prof ydb/src/ydb -q -n $# -H $leader ${extraargs:-}" & + do tagssh $rep "CPUPROFILE=ydb.prof --args ydb/src/ydb -q -n $# -H $leader --tpcc ${extraargs:-}" & done wait } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |